unity 3d student

Beginner B16 – Switching Scenes

How to write script that switches between scenes in your Unity project.

Code Used (Javascript)

var myLevel : String;
  1.  
  2. function OnCollisionEnter (myCollision : Collision) {
  3.  if(myCollision.gameObject.name == "Floor"){
  4.   Application.LoadLevel(myLevel);
  5.  }
  6. }

Further Reading

Share via Social Media

  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Add to favorites

31 Comments