0
\$\begingroup\$

I am making an XR game, and I am stuck with a part. Does anyone know a function that would detect this? OnCollisionEnter and OnTriggerEnter don't appear to work with a CharacterController. Can anyone help?

\$\endgroup\$
0
\$\begingroup\$

OnCollisionEnter and OnTriggerEnter require both objects to have colliders and at least one of the objects to have a Rigidbody. You might also try OnControllerColliderHit, which is documented here.

\$\endgroup\$
2
  • \$\begingroup\$ Is there any other way of testing for a collision with a character controller? \$\endgroup\$ – OskarZyg Jul 13 '20 at 18:39
  • \$\begingroup\$ You can look at OnControllerColliderHit(): docs.unity3d.com/ScriptReference/… You haven't provided any information about what you've already tried or how your objects are set up, so it's difficult to give more specific answers. \$\endgroup\$ – Kevin Jul 13 '20 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.