How could one detect an object touching a stationary charactercontroller? (for example: a big rock, a platform, scripted objects, not physics controlled ones)
I already learned a few things:
- OnControllerColliderHit doenst get called when the charactercontroller is’t moving (this is the main problem, looking for a way around this)
- A kinematic rigidbody object (eg platform) doens’t fire it’s OnCollisionEnter, since the charactercontroller isn’t a rigidbody (see collision matrix). This gives us 3 solutions:
- make the platform a non-kinematic one. Problem: you can’t put a physics controlled platform on a predefined path because it hits the charactercontroller and deviates from that path.
- make the character a rigidbody. This should be a kinematic one because it doens’t have to be (or may not) be controlled by the physics. Problem: the platform (or moving object) is also kinematic one, because a platform needs to stay on it’s path, and 2 kinemtatic rigidbodies don’t fire a collision.
- make the character a non-kinematic rigidbody so the platforms can be kinematic ones, and collision do get fired. Problem: the rigidbody character will get pushed away by the non-kinematic object. I don’t always want this behavior
Are there any other options so a charactercontroller can detect incoming collisions?