After game is reset something happens

After we lose the game we are then put back to the main menu now the problem is when this happens and we press play again some of our triggers no longer work like our death trigger that kills you instantly. you can walk accross it and the animation plays but no death

Does anyone have any ideas?

I think you will have more luck if you show us some of the code that isnt working. My guess from seeing nothing so far, would be you have forgotten to reset some values or removed some objects that initially where placed in the Scene.

I would show some code but there is a lot of it and unity wont allow me to place so much text in here

1 Answer

1

The simplest way to return to the main menu is:

Application.LoadLevel(0);

This reloads everything, except global (class) variables.

That is what i have done. How would i reset all the Global variables without creating a script that would call them all when my play or continue buttone is pressed and also with out making them all static Also i have noticeds something else if i change a value in A AI script the value changes for every enemy

You can't. This is why you shouldn't over-use class variables. As for your AI script, yes, that's how static/global/class variables work: one variable shared by all instances.

Class variables are those with "static". The others are instance variables.