|
Aniam Ingmann
llOwnage(float pwnage);
Join date: 22 Oct 2005
Posts: 206
|
11-19-2007 15:38
I'm trying to figure out how to have an object apear to "hover" (fluctuate smoothly from lower to higher) but for some reason this script i wrote does not work. it simply just increases height slowly... why? Is there an alternative to this? I would like to have it smooth rather than instantaneous changes; that destroys the "hover" effect. From: someone default { state_entry() { state buoyup; } } state buoyup { state_entry() { llSetBuoyancy(1.1); llSetTimerEvent(1); } timer() { llSetTimerEvent(0); state buoydown; } } state buoydown { state_entry() { llSetBuoyancy(.9); llSetTimerEvent(1); } timer() { llSetTimerEvent(0); state buoyup; } }
_____________________
From: someone Don't worry, Aniam is here! - Noob
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
11-19-2007 15:58
Try llMoveToTarget maybe. No idea why this didn't work... someone who knows more about the physics engine in SL may have an idea.
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
11-19-2007 16:47
Hmm. Might try setting the buoyancy to 1.0, then using small llApplyImpulse vectors to nudge it up and down on the z axis.
|
|
Aniam Ingmann
llOwnage(float pwnage);
Join date: 22 Oct 2005
Posts: 206
|
11-19-2007 16:51
wouldn't apply impulse make a very jumpy looking hover?
_____________________
From: someone Don't worry, Aniam is here! - Noob
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
11-19-2007 17:02
Well, I suppose it depends on how big an impulse you use.  If you are looking for a smooth accelerate/decelerate effect, you'll probably have to play around with llMoveToTarget or llSetForce. llMoveToTarget will be probably the least lag-sensitive.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-19-2007 17:11
What you posted does work Aniam. You can also save a little sim overhead if you try it like this: integer up = TRUE;
default { touch_start(integer total_number) { llSetStatus(STATUS_PHYSICS, TRUE); llSetTimerEvent(1.0); } timer() { if(up)//this reads as: if(up == TRUE) { llSetBuoyancy(1.1); up = FALSE; } else { llSetBuoyancy(0.9); up = TRUE; } } }
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-19-2007 17:21
Am getting some flunctuations thou. Sometimes it will go up,down,up,down. Other times up,up,up,up and another time up,up,down,down. And this is in Aditi Havoc 1. Would imagine it could be much worse at times in MG.
If you take and nudge it sideways a little by hand then it does what you want and seems pretty smooth.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|