I’ve got this script I’m trying to only happen when an object with a “waypointcube” tag collides with it. The debug I put in the script is not working. Therefore, what is not setup correctly?
function OnCollisionEnter (collision : Collision) {
if (collision.gameObject.CompareTag ("waypointcube")){
Debug.Log("hit");
}
}
Put logging before the if which outputs collision.gameObject.tag to see wether the function is called at all and what you're hitting.
Put logging before the
– anon76248444ifwhich outputscollision.gameObject.tagto see wether the function is called at all and what you're hitting.Did you try logging the tag there to see if the tag "waypointcube" ever comes up? Maybe it's just a matter of case sensitivity (e.g. "WayPointCube")?
– anon76248444