I’m using the Havok Physics plugin. In the video, my character walks on a flat surface. I’ve set up collision event callbacks to monitor the status of collision event types, such as COLLISION_STARTED and COLLISION_FINISHED. However, even though I’m only walking, I sometimes see this cycle: STARTED, CONTINUED, FINISHED.
I’m not jumping, floating, or doing anything else — just walking. The only event I should see is COLLISION_STARTED. Any ideas on what might be wrong?
P.S.: I’m using the latest versions of all libraries.
@carolhmj any idea, what it could be?
Hmmmmm my suspicion is that the character movement is set, it might have some downward component that contacts with the ground, and this causes a collision to be processed start to finish. I tried setting up a similar scene here: Character Import and animation | Babylon.js Playground (babylonjs.com), but I’m mostly only seeing the collision continued. Any chance you can set up a PG on your side?
I’ll tag @eoin too as he probably has a better idea of what’s going on.
Contact events will be raised for every “subshape” that a body collides with; if that character is sliding across a highly-tessellated mesh, then I’d expect to see those STARTED/FINISHED events for every triangle the body moved across.
@eoin Highly-tessellated mesh, like that in the video below? If so, what might the solution be that I can apply? I’m also creating a terrain from a heightmap.
Right, in that situation, I would expect multiple STARTED/FINISHED events as the body moves across the triangles. A body can interact with multiple triangles at once, so it’s important to be able to keep track of each one individually. If you want only a single event, you can just keep a count of the number encountered.