Jump to content
You are about to reply to a thread that has been inactive for 80 days.

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

Recommended Posts

Posted

Hello! I got stuck at the moment on how to make an attached object, which floats by script to make my avatar move with that same object, making a floating effect to it as well


Here is the current code, which helps me with my object float up and down, but not sure how to make my avatar to move with it as well

float meters = 0.15;  // Range of hover movement in meters.
float delay = 0;  //  Delay in seconds between movements.
integer steps = 5;  //  Higher steps mean smoother and slower movement but more server load.
integer i;  // Used to increment our steps.
string upDown = "down";  // Keeps track of up and down state


hoverPrim()
{
    while(0 == 0)
    {
        if(upDown = "down")  //  If object is down...
        {
            while(i++ < steps + 1)
            {

                llSetPos(llGetLocalPos() + <0,0,meters/steps>);  // ...move it up.
                llSleep(delay);  // Allow delay between movements.

            }
            upDown = "up";  // Now it's up!
        }
        if(upDown = "up")  // If object is up...
        {
            while(i-- >= 0) 
            {

                llSetPos(llGetLocalPos() - <0,0,meters/steps>);  // ...move it down.
                llSleep(delay);  // Allow delay between movements.
;
            }
            upDown = "down";  // Now it's down!
        }
    }
}

default
{
    state_entry()
    {
        hoverPrim();
    }
}

 

You are about to reply to a thread that has been inactive for 80 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
×
×
  • Create New...