Jump to content

Making an object point towards another AND move in that direction


Iva Rhapsody
 Share

You are about to reply to a thread that has been inactive for 4634 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am trying to cause a linkset to point at a target object and then go to it..I was able to get it to point properly using

Point2Object( key UUID )
{
        vector a = llList2Vector(llGetObjectDetails(UUID, ([OBJECT_POS])),0);
        llSetRot(llRotBetween(<0,0,-1>,llVecNorm(a - llGetPos())));    
}

which worked fine, then I added code using llMoveToTarget, it moves towards the target just fine but doing this defeats the point @ function above for some reason..it's orientation stays the same regardless of the targets position.

 

state fly
{
    state_entry()
    {
        Point2Object( target );
        llMoveToTarget(target_pos,0.4);
        llSetTimerEvent(.1);
    }
    timer()
    {
        animate();
        Point2Object( target );
    }
    
    at_target(integer tnum, vector targetpos, vector ourpos)
    {
        llTargetRemove( target_id );
        GetTarget();
        state hover;
    }   
}

 Any ideas ?

 

Link to comment
Share on other sites

  • 2 weeks later...

Thanx everyone I have everything working just fine, but I want to mention that despite what others may say..size DOES matter.

 

I rebuilt my dragonflies orienting all prims x forward and z up and incorporated your suggestions and viola!, however when i used the same link set as a template, simply resizing a few prims, dropping in different sculpt textures and retexturing to make my butterflies they refused to turn to point at the target, after trying everything I could think of i stretched the linkset a bit & it worked!..I then dropped my skirt resizer into the root and nudged it up step by step till the script would function properly..I suspect there is a physics engine limit to the smallest prim you can incorporate into the set so if all else fails you may have to bump up the size or use nanoprims since I'm sure it's the size of the bounding box, not the sculpted prims apparent size that counts.

anyway my butterflies are slightly larger than life, but what isn't in sl lol.

 

Thanks again

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4634 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...