Jump to content

what am I getting wrong here?


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

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

Recommended Posts

This is a script that I've come across for a tank tread, thing is that the animation should be sliding on the X axis but is clearly sliding on the Y

 

float speed;

default
{
    state_entry()
    {
    }

   link_message(integer sender_num, integer num, string str, key id)
    {
        if(str == "WHEEL_DRIVING")
        {
            state driving;
        }                                              
    }
       
}

state driving
{
    state_entry()
    {
        llSetTimerEvent(0.5);
    }

    timer()
    {
        vector vel = llGetVel();
        speed = llVecMag(vel);
        if(speed < 0.5)
        {
            llStopSound();
            llSetTextureAnim(1, 0, 0, 0, 0, 0, 0);
        }
        else
        {
            llLoopSound("fe04e8a4-28a2-1870-7889-27b2d964c669",1.0);
        }
     
}
   link_message(integer sender_num, integer num, string str, key id)
    {
        if(str == "WHEEL_DEFAULT")
        {
            state default;
        }
 
        if(str == "WHEEL_FORWARD")
        {   
            llSetTextureAnim(ANIM_ON|LOOP|SMOOTH,ALL_SIDES,1,0,0,0,speed / 2); 
        }
 
        if(str == "WHEEL_REVERSE")
        {
            llSetTextureAnim(ANIM_ON|LOOP|SMOOTH|REVERSE,ALL_SIDES,1,0,0,0,speed / 2);
        }
                   
        if(str == "WHEEL_RIGHT")
        {
            llSetTextureAnim(1, 0, 0, 0, 0, 0, 0);
        }
       
        if(str == "WHEEL_LEFT")
        {
            llSetTextureAnim(ANIM_ON|LOOP|SMOOTH,ALL_SIDES,1,0,0,0,speed / 2);
        }
                  
    }
   
    state_exit()
    {
        llSetTextureAnim(0,ALL_SIDES,1,0,0,0,0);
        llStopSound();
    }
   
}

Any help would be appreciated.

Link to post
Share on other sites

Unfortunately, that's the way llSetTextureAnim works.  Your only choice is to rotate the original image. You shouldn't have to change the UV  map, though.  All you need to do, as Jenni says, is apply the texture to the map at 90 degrees to where it is now.

Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 2966 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...