I have a sprite of a button that shows up when you die and I want to make it so when you press it that it reloads the level. (Application.LoadLevel()) How do I get it to change the scene when I click on the button but nothing else.
NOTE: This is NOT using GUI.button or any GUI elements, it is simply a sprite/gameobject.
This will work on android, if you want a more robust solution you can raycast touches yourself to emulate a mouse. That way you have a but more control in multi-touch scenarios.
– JanusMirithThanks! Cant believe I didn't think of that.. I was trying to use raycasting but I couldn't figure that out either, so this suits me fine!
– shay4545Just remember is you want to start moving around that sprite you will want to put a kinematic rigidbody on it, otherwise you are moving a static collider and that kills performance.
– JanusMirith