Reset?

How do you include a Reset Button, either as part of the GUI or assigned to a keyboard key?
This seems pretty obvious but couldn’t find it anywhere.
thanks,
Shane

Hi Schmeck,

I’m not sure what you mean by Reset. Do you want to create a button which calls a reset function that you write, when pressed?

Or do you mean a more general function to completely restart a Unity player?

Assuming that you don’t have any singletons to re-initialise, I suppose you could just load the current level again. Alternatively, you could do an ExternalEval of the javascript reload function - assuming you’re in webplayer.

To reset only certain aspects of games, I’ve previously stored original positions and rotations of objects on initialisation and then in a Reset function, moved back to those and re-initialised my variables.

If one manager script is aware of all objects which might need resetting and all of these are themselves aware of how they should be reset, implementing a complete reset shouldn’t be too hard.

thank you everyone! this helped enormously and we got it working!
§