Collision events not triggered after mesh object moved by llSetKeyframedMotion
tracked
Mars Tamale
Immediately after a KFM move the non-phantom object does not raise collision events when an avatar collides with it.
Editing the object, making no changes just quiting the edit allows collision events to occur again.
Sitting on the object does the same.
Log In
Maestro Linden
marked this post as
tracked
Thanks, I think we have enough information here. In addition to your findings about linking causing the bug to not reproduce, I also see that the bug doesn't reproduce if the script is put in a simple prim box with hollow set to PRIM_PHYSICS_SHAPE_PRIM.
Mars Tamale
I suspect this relates to the way I had added the physics to the object or something that has in the last couple of years changed in the way physics is associated with DAE's when uploaded. I had an old mesh (uploaded Feb 2019) which I stripped back to its basics (1 prim box with a hole at the front for the doors) and placed the test script in. It behaved as expected generating collision events.
Going to do some more testing on this today on the Beta Grid as its starting to cost L$ with aborted uploads.
Mars Tamale
Just tried with an old rock mesh I uploaded in 2018 and that generates collision events unlike recent uploads.
Interestingly this also seems to NOThappen when the mesh is linked to another mesh objects.
With my basic cube I duplicated it & linked them then ran the script ... collisions occurred. Then unlinked it & run the KFM again and collisions were suppressed.
Maestro Linden
marked this post as
under review
I can reproduce this on Second Life Server 2026-01-28.21455867889, using a simplified version of your test script. I commented out the
moving_start
and moving_end
events, as they don't seem to make an impact on the results.It seems that if a mesh object is set to PRIM_PHYSICS_SHAPE_PRIM and starts keyframed motion, collision events fail to trigger on agent collision both while the object is moving and after the keyframed motion completes.
If the same object is set to PRIM_PHYSICS_SHAPE_CONVEX, then agent collisions trigger collision events both during and after the motion - as expected.
So far, I haven't found a bug report that's similar to this one.
Steps to reproduce:
- Import a basic box, Box.dae from here: https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/sourceModels/Box
- At import time, set the "High" LoD as the physics model - which will just be the 6-sided box
- Rez the mesh box
- Create this script in the mesh box:
default
{
state_entry()
{
// set non-convex physics, and make it 2m
integer shape;
shape = PRIM_PHYSICS_SHAPE_PRIM;
//shape = PRIM_PHYSICS_SHAPE_CONVEX;
llSetPrimitiveParams([PRIM_PHYSICS_SHAPE_TYPE, shape,
PRIM_SIZE, <2, 2, 2>
]);
}
touch_start(integer total_number)
{
llSetKeyframedMotion([
<0,2,0>,1,
<2,0,0>,1,
<0,-2,0>,1,
<-2,0,0>,1
],
[KFM_MODE, KFM_FORWARD, KFM_DATA, KFM_TRANSLATION]
);
}
/* moving_start()
{
llSay(0, "Stand Clear!");
}
moving_end()
{
llSetKeyframedMotion([],[]);
llSay(0, "Stopped");
}
*/
collision(integer total_number)
{
integer i;
for (i=0; i<total_number; ++i)
llSay(0, "Collision " + llDetectedName(i));
}
collision_start(integer total_number)
{
integer i;
for (i=0; i<total_number;++i)
llSay(0, "Collision Start " + llDetectedName(i));
}
collision_end(integer total_number)
{
integer i;
for (i=0; i<total_number;++i)
llSay(0, "Collision End "+llDetectedName(i));
}
}
- Walk your agent into the object, and confirm the collision events produced chat
- Touch the mesh box to start the keyframed motion
- Attempt to trigger more collision events with your agent while the object is moving - note results
- Attempt to trigger more collision events with your agent after the object stops moving
- Recompile the script with shape = PRIM_PHYSICS_SHAPE_CONVEX;
- Repeat steps (4)-(7)
Expected results:
The collision(), collision_start(), and collision_end() events should produced chat whenever the agent collides with the object, whether it is using 'convex' or 'prim' collision shape, and also whether it is in keyframed motion or not.
Actual results:
- When the mesh uses PRIM_PHYSICS_SHAPE_PRIM, collision events only work before the keyframed motion begins. The events are not triggered during or after keyframed motion, although the agent collides with the object.
- When the mesh uses PRIM_PHYSICS_SHAPE_CONVEX, expected results occur
Mars Tamale
Same probably happens with llMoveToTarget but ran out of testing time.