onCollisionStart and onCollisionEnd not triggering

I have an issue with my rigidbodies where the onCollisionStart and End don’t appear to trigger. The first rigidbody is dynamic and is supposed to move away from the other static rigidbody when the start to collide. For whatever reason the two just ignore each other.
Project: https://playcanvas.com/editor/scene/586668
Dynamic Rigidbody script: https://playcanvas.com/editor/code/532971?tabs=11166853,11164177,11205172,11168391

From a rough guess looking at the project, only the pearl entities are moving due to them being a child of the wheel, not their rigid bodies which are ‘separate’.

Once there is a rigid body component, you should be applying forces and torque to move it rather than setting the position of the entity. If you do the latter, the entity will be out of sync with the rigid body.

In this case, it is not advisable to have a rigid body as a child of another rigid body for this reason.

You can compound two dynamic rigid bodies together (the pearls should be dynamic, not static as you are intending them to move in the world) but you have to start digging into the ammo.js
API as they aren’t exposed via PlayCanvas.

My plan is to remove the rigidbody from the wheel itself and just move that without physics, and I figured that the best way to get an interaction between the pearls and the pointer was to make them physics objects and let physics do the work there.
I think I see what you mean about moving the rigidbodies with physics though. As it is, it’s probably just the model of the pearl moving with the wheel, while the rigidbody is still sitting in place. As a test, is there a way to make the rigidbody components themselves visible in the launch window?

I tried something like this. I added the pearls to the model of the wheel, instead of having them as separate models as children of the wheel. For some reason, when I make the rigidbody for the new wheel dynamic, and give it a mesh collider (I have read the API for this and I know it says mesh colliders should be static) the pointer still seems to ignore the contact. Also tried making the pearls a single model with a mesh collider and dynamic rigidbody, gave that the same script to rotate as the wheel, but collisions still aren’t occuring.

Do you have a version of this project available to look at?

Yes, the link provided in my initial post will take you to the project. I just found that giving the pearls a sphere collider and moving them into the pointer triggers the collision, the only thing is I don’t know how to make the individual rigidbodies rotate around the center of the wheel.

Unfortunately the state of the project doesn’t allow me to quickly look at the issue you had at this post onCollisionStart and onCollisionEnd not triggering

This is a good reference to the effect you are looking for without using physics: https://youtu.be/t9u9X4IfCGI?t=400

I did change some things to test various solutions, and what I have found is that dynamic rigidbodies are ignoring static rigidbodies (in the case of two box rigidbodies I added to stop the pointer from rotating past a certain point).

As for this, all this does at the moment is log the word Bump when the pointer hits something, and debump when the collision ends.

And yes, this is sort of what I’m going for.

It’s more of the case that the wheel with the pearls as part of the physics mesh no longer spins after pressing spin and the pointer is no longer in the right place to quickly test which makes it difficult for someone to jump in and debug the issue.

I’ve moved the wheel with the pearls as part of the mesh back into place, and set the button to spin that.

Further testing with this scene seems to point to the problem being the mesh colliders. When I use a mesh collider on the pearl and pointer they pass through each other. When I use a sphere on the pearl and a mesh on the pointer the collide, but the pointer ignores the two invisible box colliders meant to prevent it from moving past a certain point. Changing the pointers collider to a box makes everything work without issue.
EDIT: The pointers do not collide with anything in the second or third change once they start moving.
EDIT EDIT: Removed scripts from pearls above pointers and collisions occured.
Test Scene: https://playcanvas.com/editor/scene/590218

Looking at the Bullet Physics author reply echos your findings: https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=&f=9&t=2927