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 /
This question was closed Aug 11, 2018 at 03:53 PM by True_Beef for the following reason:

Did not understand basic coding concepts before writing answer. OP Learned up and now face-palms at this dumb question.

avatar image
0
Question by True_Beef · Dec 18, 2014 at 12:07 PM · c#randomloadingscenesdoors

Remembering Previously Loaded Scenes "Doors"

Hey, I am making a game just to try out some mechanics i might use in a later game. It uses Randomly selected scenes from a list, to simulate a random world. You leave out of a door, it loads a random scene, etc. The problem with this is i have no idea how to make it so that if you want to go backwards into the door, it will load the scene you were already in, instead of a random one. I have no idea where to start, but i was thinking playerprefs? Hopelessly Lost, been searching for hours for a solution that might not exist. Then again, I am a novice Csharp-ist.

Any help would be greatly appreciated.

-Archy

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 True_Beef · Dec 18, 2014 at 09:25 PM 0
Share

Well its not so much as remembering open doors (Though i might use that) but remembering which scene corresponds to which door. For example if i go into a door on the left, it would randomly generate a scene. then if i want to go back through the door i just came through, it'd randomly generate another scene ins$$anonymous$$d of loading the one i was just in. I want to do the latter option.

A good example is The Binding of Isaac door mechanics. It will make a random level, then if you go back through the door it will take you to where you started.

1 Reply

  • Sort: 
avatar image
0

Answer by rensjan2122 · Dec 18, 2014 at 09:57 PM

Create an empty GameObject with this code:

 String[] DoorTarget= new String[#Doors];

 void Start(){
     DontDestroyOnLoad();
 }

 public void DoorCollision(int DoorId){
      this.id =DoorId
      Application.Load(DoorTarget[id])
 }

Every door has an Id and every id is linkt to an target you call this function with an Id, I think this would work but I didn't test it so...

Comment
Add comment · Show 2 · 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 True_Beef · Dec 18, 2014 at 10:35 PM 0
Share

So would i make four Public GameObject lines to reference all four doors?

avatar image rensjan2122 · Dec 19, 2014 at 02:26 PM 0
Share

or an array of GameObjects with every door having the same place in the array as his id

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Switching scenes 1 Answer

How do I randomly place doors, treasure chests, and traps in a randomly generated maze? 0 Answers

Recommendations on how to load characters... 2 Answers

pre-load multiple scenes but only activate one 0 Answers

How to generate a random seed at a 24 hour interval 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