Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

C# GameObject is not detecting collision with Character Controller

$
0
0
Hi everyone, I have a script that detects when a Character Controller collides with a gameobject. I have attached my script to the gameobject but the script isn't detecting when I move the Character Controller into the gameobject. Any idea what is wrong with my script? using UnityEngine; using System.Collections; public class PlayerDetect : MonoBehaviour { void OnControllerColliderHit(ControllerColliderHit playerCollider){ if(playerCollider.gameObject.tag == "Player"){ Debug.Log("Hit Player"); } } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>