|
Cy Beck
Registered User
Join date: 14 Feb 2007
Posts: 2
|
04-13-2007 11:55
Hello,
I am trying to create an object that when attached to an avatar it takes control of it and moves the object (and the avatar) forward a few meters.
I tried to use the following:
llSetStatus(STATUS_PHYSICS, TRUE); vector destination = llGetPos() + <0, 0, 10>; float range = 0.5; targetID = llTarget( destination, range ); llMoveToTarget( destination, 10 );
When the object is not attached it works but when it is attached it doesn't move the object attached (and therefore the avatar).
Can anybody point me to a tutorial or a solution to this?
Thanks in advance!
|
|
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
|
04-13-2007 11:59
You don't need to set the prim physical if it's an attachment. Also try using a lower value for tau in llMoveToTarget, if it's too low I think the force applied doesn't negate the friction or something.
|
|
Resolver Bouchard
Registered User
Join date: 19 Jul 2006
Posts: 89
|
04-13-2007 13:16
There is also a slight bug with llMoveToTarget(). If you change a script with it in you need to unequip and equip the attachment otherwise you don't move.
|
|
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
|
04-13-2007 13:38
I created this system for a client. I cant tell you exactly how its done, but llMove2Target is the right path.
One caveat, you can't turn the avatar from script.
|
|
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
|
04-13-2007 13:48
From: Resolver Bouchard There is also a slight bug with llMoveToTarget(). If you change a script with it in you need to unequip and equip the attachment otherwise you don't move. In addition to what Resolver stated you may need to go as far as dropping/rezzing the object on the ground (well in world as opposed to attached) and resetting the script. I was using a script which used physics functions in an attachment and this is how I made changes, just to be on the safe side. recap: If you make changes to your script, save the script, drop the attachment, reset the script, wear it again.
_____________________
www.nandnerd.info http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
|