|
CyanAura Femto
Registered User
Join date: 1 Feb 2004
Posts: 14
|
03-11-2009 18:36
I have scripted a flying object that searches out a target, goes to it, and stays at target for 1 minute before flying on to other tasks. About 1 out of 10 times that it arrives at target, it immediately starts drifting backwards instead of staying there.
The object normally has physics TRUE, and I use llMoveToTarget to fly it. When it finds a "target" using sensor, it then moves toward the target. The sensor event activates llTarget().
The "at_target" event does: llStopMoveToTarget() llTargetRemove(target-id) set physics to FALSE
Most of the time it does stop as it should, but sometimes when it touches target, triggers the at_target event, and starts its drift backwards. It is doing it by itself, without entering any other state, or excuting any code. It goes by itself. Any ideas why?
The script is in mono.
|
|
Nexii Malthus
[Cubitar]Mothership
Join date: 24 Apr 2006
Posts: 400
|
03-11-2009 20:27
Perhaps one of the targets is over or the llMoveToTarget limit? (has to be <64m) Otherwise you have to move in 63m increments until your close enough in a loop/timer.
_____________________
 Geometric Library, for all your 3D maths needs. https://wiki.secondlife.com/wiki/Geometric Creator of the Vertical Life Client
|
|
CyanAura Femto
Registered User
Join date: 1 Feb 2004
Posts: 14
|
03-12-2009 05:46
Thanks, Nexii. Yes, I do break moves into 60 m chunks. It does make it to target -- then about 1 in 10 times it does that fast "drift" backwards - sometimes making it go offworld in the 60 seconds I allow it to rest at target.
|
|
CyanAura Femto
Registered User
Join date: 1 Feb 2004
Posts: 14
|
03-14-2009 10:43
I think I have solved the problem - at least the symptom. In the at_target event, I removed the llStopMoveToTarget(). For some reason, that stops the "drift" backward away from the target that I was experiencing about 10% of the times.
Anybody have an explanation what is/was happening?
|
|
Paladin Pinion
The other one of 10
Join date: 3 Aug 2007
Posts: 191
|
03-14-2009 11:06
From: CyanAura Femto I think I have solved the problem - at least the symptom. In the at_target event, I removed the llStopMoveToTarget(). For some reason, that stops the "drift" backward away from the target that I was experiencing about 10% of the times.
Anybody have an explanation what is/was happening? Just a wild, uneducated guess. If the server isn't responding fast enough, there will be a short delay between the time llStopMoveToTarget is called, and when physics is disabled. During that short period, the object will no longer be pinned to a particular location but physics will still be on, which means you could get some recoil. Just a guess though.
|