- Home /
Collider working but not firing OnCollisionXYZ (in parent object)
I have a platform object, a character, and a checkpoint I use for the A.I. (the character follows the checkpoints when he "senses" them).
Taken by themselves all work perfectly: the characters keeps running over the platforms, and follows CPs. The problem is when I try to make the CP move with the platform: I made the checkpoint a child of the platform and whenever the character gets on it it just stops. Apparently the colliders still work (as the character is not passing through the platform), but no Collision event is fired involving the platform.
I would like to avoid writing a script just to make a specific CP follow the platform without using a hierarchy, but don't know what the problem is exactly!
Do both the platform and CP have rigid bodies attached to them? If so, are they both non-kinematic? Reason I ask, is because for OnCollision events to be fired, one of the colliders needs to have a non-kinematic rigid body for the events to fire.
The platform (parent) has a rigidbody and is kinematic, the CP (child) has no rigidbody at all. It moves with the platform as it should, but I have the aforementioned problem. I solved this by script, but I would like to know if there's a faster solution.