I’m trying to make my first person controller destroy game objects when it collides with them, but none of the scripts i’ve tried are working, i used OnCollisionEnter just on the gameObject and then I tried using the OnCollisionEnter paired with collision.transform.SendMessage like on the Lynda.com tutorial with no luck on either. Is there something special needed in the code about destroying gameobjects with the first person controller?
OnControllerColliderHit is only called on the gameObject with the CharacterController, and only if the controller is moving with the Move() function. Put the collision script on your GO with the CharacterController, and try something like:
I’m not completely sure this will work, but hopefully it’ll point you in the right direction. Collisions can be tricky to figure out at first, and I still have issues with them. I’d suggest searching Unity Answers or even just google with the keywords of your problem. 99% of the time I’ve found a solution that way.