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");
}
}
}
↧