Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stay on the floor!!!

Imajica Hand
Registered User
Join date: 3 Feb 2006
Posts: 66
07-11-2006 08:52
Hi there!

I've done a follower object... a simple script, that use sensor to find owner each 60 seconds (i dont need that object follow the owner in realtime).

Its all ok but... how I can put this object on the floor? I cant understand how to calculate right z coordinates. I've tried using owner heigth, object (linked prims) bounding box, a combination of all that... well, I cant understand, really.


Thanks to all! ;)
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
07-11-2006 09:01
Hve you looked at llGround()?

I suspect it may be what you want.
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
07-11-2006 09:29
llGround won't work if he is standing on a platform. Better to have the follower subtract half your height from your current z coordinate and use that for its z position. Something like the following:

CODE

sensor(integer num) {
vector position = llDetectedPos(0);
vector size = llGetAgentSize(llDetectedKey(0));
llSetPos(position + <1.0, 0, -(size.z / 2)>);
}


That is untested code but it should put the follower one meter north of your position at the same level as your feet.
Yzordderrex Opus
Registered User
Join date: 23 May 2006
Posts: 1
07-11-2006 16:12
I've tried using half avatar height, but the object float... I've tried also using half height of avatar and object height... nothing...
I cant understand...
Morgan Mirabeau
Registered User
Join date: 15 Sep 2005
Posts: 1
07-11-2006 16:50
Are you perhaps using llSetHoverHeight() somewhere?
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
07-11-2006 21:35
use this:

AVposition.z - (.5 * llGetAgentSize.z) + (.5 * Objectheight.z)
that should get you there.

note: psudocode will not even come close to compiling ;)

oh and this doesn't take into account animations or anything so won't work on tinies etc.
_____________________