Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I need to make my UFO raise and lower as it sits and rotates

Ciera Spyker
Queen of SL
Join date: 25 Mar 2008
Posts: 424
06-24-2008 19:52
Sit and rotate is easy, I have a "captive" UFO ina glass tube that I want to slowly rise and fall vertically in. (They are in the towers on POP land @ VERONA- i f some one needs a visual reference.)

they currently rotate well but the up/down hasn't worked to well for me yet. Im betting this a simple script, yet Im a dunce. :)

Thanks ahead of time.
Ciera Spyker
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
06-24-2008 21:37
Not a good bet... lol, there's several ways to do this, depending on weather the object is physical or not. If it's not physical, you can use llSetPos(), generally in a loop with a delay (llSleep()), so that the movement isn't too fast. If the object is Physical, there's a couple of different ways it can be done, using the llTarget() and llMoveToTarget() functions, and the at_target() and not_at_target() events to set waypoints (llTarget()), and move the object to the waypoints (llMoveToTarget()), and the events to trap when the object reaches the destination waypoints. Hope that helps :)


http://www.secondscripter.com
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Rock Vacirca
riches to rags
Join date: 18 Oct 2006
Posts: 1,093
06-27-2008 03:10
From: Ciera Spyker
Sit and rotate is easy, I have a "captive" UFO ina glass tube that I want to slowly rise and fall vertically in. (They are in the towers on POP land @ VERONA- i f some one needs a visual reference.)

they currently rotate well but the up/down hasn't worked to well for me yet. Im betting this a simple script, yet Im a dunce. :)

Thanks ahead of time.
Ciera Spyker


I have made a raise and lower script which you are welcome to have a copy of. Contact me in world.

Rock
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
06-27-2008 03:58
vector vA = llGetPos(); // Use current position as base position for the hovering.
float radians = 0.0;
float deltaheight = 0.5;


and in a timer event you have:

radians += 0.05;
if (radians > TWO_PI) {radians -= TWO_PI;};
llSetPos(vA + <0,0,llSin(radians)* deltaHeight>;);


And there it is. Your object "floating" or "hovering" up and down along a sinus path. As choppy or as smooth as timers will allow.