I am using unityscript and I have no idea why but the OnCollisionEnter Function never calls, even when logging it in unity3d. Is there an alternative or a reason why this is happening?
By the way I am trying to use this collision detection function to find out if the Main Camera is touching a wall or anything.done
This is exactly what I have done:
- I created a unityscript file.
I replaced all the contents with just:
function OnCollisionEnter(theCollision : Collision) { Debug.Log("Hit"); }Now I drag that file, having been saved, to Main Camera.
- In the game I move the main camera to a wall or cube object, but it does not Log "Hit".
Thanks