moving_end()
This
event is triggered when an
object (
physical or
nonphysical) with this
script stops moving (and changes
position, including when
attached) or enters a
sim.
Compare with
moving_start.
Example:
Q: Will moving_end be triggered when I change the rotation of my object?
A: No, both moving_start and moving_end are only triggered by a position change. There is no way to trigger on a rotation directly. To do so, you'll need to use a timer. The "exception" to this is if the object is an attachment. When your avatar turns, moving_start and moving_end will be triggered. Why? Because they're moving; their position has changed, because they're not rotating around the avatar's point of rotation, but rather in an arc.
Q: Is there a way to only trigger moving_end when entering a different sim?
A: No, the best you can do is filter your event as in:
string gCurrentSim; // current simulator name
default {
moving_end(){
// sim_name is so we only need to call llGetRegionName once.
string sim_name = llGetRegionName();
if (sim_name != gCurrentSim) {
// if we're here, it means we've just entered a new sim.
llOwnerSay("Entered " + sim_name + ".");
gCurrentSim = sim_name;
}
}
}
Events |
Position