Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
  • Help Room /
avatar image
0
Question by alf1ew4rd2832 · Feb 17, 2021 at 11:30 AM · sceneschanging

Wrong Scene Loading On Change

I have 8 levels and in each level i have atrigger to move onto an intermediate whch shows the player their score for that level. They can pres next to go to next level. For level 1 whn you finsih intermediate1 will open and shows you the score. For level2 intermediate2 opens and shows you your score same for 3. But for 4,5,6,7 and 8. The intermediate1 will open rather than the corresponding one. However, if i remove intermediate1 from the build settings then intermediate 6 for example will load for level 6 rather than intermedaite 1. Code For Trigger In Level1

using UnityEngine.SceneManagement; using System.Collections; using UnityEngine;

public class EndTrigger1 : MonoBehaviour {

 //this is the function which reacts to a colision from an object
 private void OnTriggerEnter()
 {
     //here a function is being used to look at the created sceness. 
     //Each scene has an idex.
     //On collision the index is implemented by one and the function fetches the new scene with that index and plays it.
     SceneManager.LoadScene("Intermediate1");
 }


}

Code For Trigger In Level6

using UnityEngine.SceneManagement; using System.Collections; using UnityEngine;

public class EndTrigger6 : MonoBehaviour {

 //this is the function which reacts to a colision from an object
 private void OnTriggerEnter(Collider other)
 {
     //here a function is being used to look at the created sceness. 
     //Each scene has an idex.
     //On collision the index is implemented by one and the function fetches the new scene with that index and plays it.
     SceneManager.LoadScene("Intermediate6");
 }


}

Everything looks right in the build settings but i don't why intermediate 1 loads when the player hits the trigger in level 6. If you could help i would really appreciate your time.,So I am making a game and when a box is hit it is used as a trigger and loads an intermediate scene which will show the player their score. Levels 1 to and 3 work finr but the others dont. When you complete level 1 it loads the scene which shows the level 1 score however when you complete level 6 it again loads the level 1 intermediate. alt text

alt text

1.png (223.9 kB)
2.png (228.3 kB)
Comment
Add comment · Show 1
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 Timber-Roar · May 26 at 05:48 PM 0
Share

Not sure if it's the same problem but when I had a similar issue it was caused by a different LoadScene() being triggered elsewhere in my code. Try doing a search for other instances of LoadScene() in your project, they may be getting called before the intended one.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by WolverineLight · May 27 at 03:22 PM

Hello alf1ew4rd2832,

Are you sure you have the right script attached to the trigger in the intermediate6 scene? That is my best guess - you likely duplicated something but forgot to change your script(s).

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

160 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Hello, help with animation between scenes 0 Answers

Complicated level change problem 1 Answer

Bug in scenemanager when using GetSceneAt?? 0 Answers

Coroutine couldn't be started because the game object 'Scene Loader' is inactive 1 Answer

Player GameObject is not being positioned where my SceneController tells it to after scene transition. 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