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 · Sep 02, 2011 at 02:32 PM · scenelevelloadlevel

linking levels?

how do I link levels together? Say I want, when the character "falls off the edge" and falls for infinity, for him to hit a terrain that will load him to the next level, how can this be done? basicly I want a continuous loop of 2 levels I have created. when one falls from the edge of one, and hits the "under terrain", it will load the character to my next created level. this level does the same as the first, only loading the character to the original level...a purgatory of sorts (Don't ask, it's for an art installation). Can anyone help me with this. I have taught myself Unity and know the basics, but know nothing of scripts, and can barely navigate the inner workings of the software. can someone baby step my way through this issue? PLEASE!!!

Comment
Add comment · Show 7
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 em2 · Sep 02, 2011 at 03:10 PM 0
Share

Hi Damien, what do you need more than you asked here? http://answers.unity3d.com/questions/120083/how-to-link-scenes-.html Which bit are you having more trouble with? Chris

avatar image Damien78 · Sep 02, 2011 at 03:48 PM 0
Share

Thanks for the quick reply chris. So I've just added a cube collider, set it to triggger, changed my First person controller tag to "player", and put in the script mentioned here:

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");

PLEASE help clairify a few things? 1)"other is the collider"= do I change that name to "first person controller" if that is my name for my character? 2)set tag of player's mesh with a collider? is this done in inspector of first person controller under tag? 3) do I change maridiion to the name of my scene I wish to upload? I"ve just tried a few things but no luck so far. clarification on this script and how to implement it would be great. I'll even give a big shout out when my art show opens in early October :)

avatar image Damien78 · Sep 02, 2011 at 04:33 PM 0
Share

the script seems sound except i get the problem: Assets/NewBehaviourScript.js(1,34): BCE0018: The name 'collider' does not denote a valid type. I guess my main issue is what names(like collider) I have to substitute for my own eg. box collider, etc. what names mean what? is collider my player,or the box? also, when I put in my scene's name into the load level script...it's red. is this bad? I have saved it (build settings) with the rest of my scenes. the same goes for:

if (player.CompareTag ("First Person Controller Prefab")) return;

what should be in the parenthesess? my character name? or just player? player came up as an "invalid type" as well.... like I said, I'm new to this...:(

avatar image em2 · Sep 02, 2011 at 04:44 PM 0
Share

No problem, hopefully it can help. 1. See if this resource answers your question regarding the code http://technology.blurst.com/unity-physics-trigger-collider-examples/ Yes at some point as I understand it you name the object (in the example they are comparing tags). Yes you can set the object (cube) as a trigger in the inspector. Yes you will add the name of your scene where the maridiion is. Don't forget when you publish you will need to add both scenes to the build for it to work. Going to have to crash soon, its 3am here. :-)

avatar image em2 · Sep 02, 2011 at 04:49 PM 0
Share

yes the tag of your object (in your case player) can be set in the inspector.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by em2 · Sep 05, 2011 at 02:06 AM

Hi Damien, sorry for the delayed reply, have been away from my machine. See where you are saying (other:Collider), "other" is the name you are giving to the object. Then you are asking it, is an object you have called player colliding with it, so that is causing your error becasue unity doesn't know what the player object is. Try changing (player.CompareTag...etc to (other.CcompareTag...etc. Make sure that you have set your game object that is being collided with i.e your cube (and it is also the one you put this script on) is ticked as "is trigger" in the inspector.

Use this:

   function OnTriggerEnter (other: Collider){
         if (other.CompareTag ("Player"))
         Application.LoadLevel ("Painting2");
     }

Cheers Chris

Comment
Add comment · Show 3 · 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 em2 · Sep 05, 2011 at 03:50 AM 0
Share

Hi Damien, can I suggest that you maybe edit the name of your question so it would be more easily found in a search by someone having a similar problem. If this does solve it, it would be great if you can accept answer, it also helps others to find it. Cheers Chris

avatar image Damien78 · Sep 06, 2011 at 02:13 AM 0
Share

Thank you Chris. I finally got it to work. much appreciated. Lesson well learned. You will definitely be getting some cred during my artist talk in october. visit my website if you like: http://www.wix.com/damworth/damien-worth

avatar image em2 · Sep 06, 2011 at 02:42 AM 0
Share

No problem Damien, thank you, glad it worked. All the best with your presentation. Will check out your site. Cheers Chris

avatar image
0

Answer by em2 · Sep 02, 2011 at 02:46 PM

Have a look at OnTriggerEnter in the unity documentation at http://unity3d.com/support/documentation/ScriptReference/Collider.html , as I expect you could add an object for your falling character to hit (trigger) to launch your next scene. Then implement in reverse in the next scene, where the trigger loads the first scene again. You will also see the trigger check box in the inspector panel. Hope this helps. Cheers Chris

I should have also included load level at, http://unity3d.com/support/documentation/ScriptReference/Application.LoadLevel.html

Chris

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Problem to go to another world scene in level select lock/unlock 0 Answers

Can I utilize LoadLevelAdditive for immersive game? 2 Answers

Load Level on Collision 1 Answer

Allow userto load custom unity levels/scenes. 2 Answers

How Do I Exit Level? 1 Answer


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