Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Damien78 · May 22, 2011 at 02:41 PM · sceneslevelsswitch scenes

how to link scenes ?

I am looking to link 2 or 3 scenes together so that when you "fall off the edge" to a certain depth, you will jump (load) to the next level? can this be done and how? Also, at the last scene of the sequence, when falling off its edge, I want it to link back to the first scene. a sort of eternal loop thing. how do I link scenes based on the "falling off for eternity" thing? any help would be great, thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by DaveA · May 22, 2011 at 02:49 PM

Make a gameobject with, say, a CubeCollider (any collider will do), set to 'is trigger' and script the 'OnTriggerEnter' to use Application.LoadLevel. Place the object/collider where it will 'catch' the falling player. When they fall into it, it will switch scenes.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
-1

Answer by Kiffster11 · Apr 28, 2012 at 12:18 PM

is there a code to change scene's on a mouse click, i want to go from my Scene 1 to Scene 2 by clicking on a certain cube

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Damien78 · May 24, 2011 at 12:23 AM

thank you so much for your help here. I am still new to unity and am having trouble with these scripts. I set my cube collider to "is trigger", but am unsure how to script the "on TriggerEnter" to use Application.LoadLevel. Also,where do I type in the level in which I want the character transported to? is it eg. Application.maridiion(if this is the name of the level)? Sorry for the noob questions, I'd just really like this to work.

I can't even find where the "OnTriggerEnter" option...or is this just a simple script?

help please

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by save · May 24, 2011 at 12:43 AM

Instead of writing your new question as an answer here you can use the comment below an answer to question it - otherwise it'll get confusing for other people that is looking for a solution.

It sounds like you need to read up on the scripting reference, give it some time and you'll get the hang of it. The OnTriggerEnter and Application.Loadlevel works like this:

 function OnTriggerEnter (other : Collider) {
      /*other is the collider that enters the trigger area 
        we first check if the collider is the player (set the 
        tag of the player's mesh with a collider to "Player")
        if it's not the player then return (escapes the function from below the return-line)
      */
      if (!other.CompareTag ("Player")) return;
 
      //Load the level
      Application.LoadLevel ("maridiion");
 
 }

This code is using javascript (so you create a js-file from unity, put the code into it, drag the file onto the object - or in some cases reference to the file from other scripts). The manual will get you started with these basics.

Although it sounds like you might want to look at a solution for looping your scene instead of loading levels, there you could either look at additive loading scenes onto your scene, the transform position of each gameobject or instantiation of new while you destroy the already passed.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How do I change scenes from triggers in UNity 1 Answer

How to teleport to different scenes? 2 Answers

Reduce 'Levels' or Scene File Size 1 Answer

Online levels database 0 Answers

Unity game level design patterns 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges