Quantcast
Channel: Answers for "Script for changing levels"
Viewing all articles
Browse latest Browse all 6

Answer by Ashkan_gc

$
0
0

add a collider to that cube object that you want to change level when colliding with it. check the is trigger of the collider that you attached and write something like this in a script.

function OnTriggerEnter (other : Collider)
{
if (other.tag = "player")
{
   Application.LoadLevel ("levelname"); 
}

put the level name in the "" you can expose this as a string and set it inside the inspector or just create a manager.


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>