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 /
avatar image
0
Question by warfronts · Mar 26, 2014 at 04:09 PM · fpsmobilememoryleveltransition

Level transition 2d runner game mobile

How can we transition from one level to another in a side scroll runner without loading a new scene.

The method that I'm using is:

  • Edit the game object in the editor (move, scale, rotate) whatever.

  • Press apply to the gameObject to reflect the changes to the prefab

  • Then disable the gameobject

  • My ResourceManager.cs will do the work and instantiate a copy of the gameobject at runtime when I want (maybe it will generate a problem related with gameObject references).

My question is there a better way to solve this issue? I'm trying to not overuse memory. The bad thing is that I have a lot of gameObjects for one level. I think that should be a faster and better way to do it.

alt text

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 corriedotdev · Mar 26, 2014 at 05:36 PM 0
Share

what would be helpful is a screenshot of your hierarchy? That way we can see if certain methods will conflict with the items you have.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Leuthil · Mar 26, 2014 at 05:12 PM

Funny thing is that I'm actually doing something very similar in my current project. I will tell you right now that from my tests and findings, using Instantiate to load Prefabs causes a significant game freeze for a split second that is very noticeable (at least on mobile, I'm testing on Android at the moment).

I am now trying to convert my system to a pooling system. Basically it was load a couple of each type of prefab when the game first starts and deactivate them until needed. Once one is needed, it will reactivate and move it into the correct spot. Once that prefab instance goes off-screen I deactivate it again.

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 warfronts · Mar 27, 2014 at 07:55 AM

Mmmmm... yes I could have all objects here (level0, level1, ... leveln) and only activate the ones that I need but, I think this is a bad approach because it will be a lot of Inactive GameObjects taking memory.

The way i would like to do it when changing to level0 to level1 was like "removing all objects from level0" instantiating all objects from level1.

I still thinking the best way to do it.

Thanks for your answer.

Comment
Add comment · Show 1 · 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 Leuthil · Mar 27, 2014 at 12:37 PM 0
Share

You can try it but you will notice the game freeze while it Instantiates all those objects.

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

22 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

Related Questions

Mobile input problem for first-person shooter 0 Answers

Profiler says that game is running at 10ms(100FPS) but on mobile runs at 45FPS. 2 Answers

Is it ok to have just one scene for a whole game? 0 Answers

spawn points/ player transition from level to level with multiple exits and entrances 3 Answers

Why Unity has high memory usage on empty scene? (Android) 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