- Home /
Question by
kevinrocks_786 · Jul 03, 2015 at 01:55 PM ·
collisionnot workingfailure
Collision not working
So I made a simple script that takes you to the main menu when an enemy collides with you. I got it to work and it had 0 errors. Everything worked perfectly. Then I saved my project, saved my scene and closed Unity. However when I reopen my project, the script doesn't work. At all. Why does Unity do this? It's not the first time this happens to me. At first it works but then when I restart Unity it doesn't work anymore...
Here's my code...
EDIT: Remember there are 0 errors and the scene is in the build settings. Nothing from the script was changed at all. Yet it stopped working all of the sudden.
#pragma strict
function OnCollisionEnter (collision : Collision) {
if (collision.gameObject.tag == "Ghost") {
Application.LoadLevel("intro test");
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613201653im_/https://answers.unity.com/themes/thub/images/avi.jpg)