Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripter movement help

Floog Stuart
Registered User
Join date: 28 Jun 2006
Posts: 12
08-22-2006 14:21
I'm relatively experienced scripter, but I've never really worked with movement and controls. How would I make an object hover at a level that was controlled by the avatar sitting on it?
HtF Visconti
Registered User
Join date: 21 Jul 2006
Posts: 123
08-23-2006 04:10
I am a relative inexperienced scripter but I'd try it this way:

When the link change is detected when the avatar is sitting on the item I'd enable a listener that remains active as long as the avatar is still sitting. The listener could be used to control the object - alternatively you could also take the controls and try to capture the arrow keys for control.

Since object and avatar are linked when seated changing the position of the root prim will also move the avatar. So ... in the root prim should be a script that uses

llSetPos, llSetRot, llGetPos, llGetRot and the other functions.

For simple vertical hovering a llSetPos with a varaible, user controlled z coordinate and fixed x and y coordinates, taken via llGetPos shoudl suffice. Maybe a ground check so it can't hover below ground llGround( <0.0, 0.0, 0.0> ).

While this may look jerky maybe llMoveToTarget is smoother but I have never really experimented with this in a big way to offer well founded suggestions which to use.
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
08-23-2006 13:37
There is a vehicle tutorial here:

http://secondlife.com/badgeo/wakka.php?wakka=LSLTutorials
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo