I have made my game and menu but now I just need a script so when the enemy gets in a certain range or "touches" my character, it will load my menu scene (Im a little stumped with this code but i know it has to "loadlevel(0)" on the touch). Cheers (ill let you know if someones has answered my question )
These two references will be your best bet in this situation. http://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html http://docs.unity3d.com/ScriptReference/Collider.OnCollisionEnter.html
well now i have this new code: function OnCollisionEnter (collision : collision) { if (collision.gameobject .name=="GOBLIN"") Application.loadlevel (Application.loadlevel0); } my goblin has the tag "GOBLIN", i have another scene and in the build settings it is indeed numbered 0 and my fps character has a rigid body but i don't seem to know whats wrong, any ideas guys? In the picture is the code that I slightly edited
Please keep in mind that there is a difference between the GameObject's tag and name; so keep that in mind with the check inside of your method.