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 luisgualandi · Nov 09, 2018 at 08:07 PM · 3dmobileprefabsrunnerlevel design

Stacking level blocks in an Infinite runner game

I'm making a casual runner game in which I'll create many levels and stack them randomly one after another as the player moves. Each level consists of a ground block with manually placed obstacles. These items will vary in size and shape, so its important to do it manually. I could think of the following ways to do the job:

1) Make a prefab for each level and instantiate/destroy them 2) Make all levels at the gameplay scene and enable/disable them (~50 levels) 3) Make each level as a scene and load them on the gameplay scene in additive mode

Since I'm new to unity I don't know which one of this methods is costlier in terms of memory and CPU. I'm targeting mobile, so performance is important. Anyone has an idea of what is the best approach? Thanks for the help!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by hectorux · Nov 10, 2018 at 12:28 AM

Having something like a pool will cost cpu, but it wont have a very big drop in fps like when you instance/Destroy, adding scenes is not a very optimal option

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 luisgualandi · Nov 10, 2018 at 02:31 PM

@hectorux Thanks for the info. So adding scenes more costly than prefabs? Maintaining a pool of 50 levels doesn't sound smart to me. What option would you choose?

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 hectorux · Nov 10, 2018 at 03:27 PM 0
Share

In your case, depending on how meny times you would instantiate or activate those lvls, if they are small, and you do it frecuently, ithink that a pool isnt something pretty crazy(also remember to set thos unactive to better performance), if they are big, when you instantiate one, you will have a little fps drop, but ins$$anonymous$$d of having all pre-charged, will cost less CPU meanwile. Conclusion: small/meny-active(less fps media), big/some-instantiate(more ps media, but with drops(in your case maybe 4fps(i mean it isnt something that big, isn`t it?)))

avatar image luisgualandi · Nov 10, 2018 at 08:32 PM 0
Share

Really the levels chuncks are pretty small, but will be called frequently(every ~4 sec). I think instantiating or async loading scenes won't have much impact on fps, but I'm not sure. Also apparently if I were to use prefabs I'd have to download the new beta version of Unity with nested prefabs.

avatar image hectorux luisgualandi · Nov 10, 2018 at 09:25 PM 0
Share

there is a plugin of nested prefab in the aset stroe(if i dont remeber well ithink is free)

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

153 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

Related Questions

How do I make a bowling ball curve and gain friction in certain points? 0 Answers

How to drag and move a character left and right using touch controls in an endless runner game? 0 Answers

How can i rotate 3D object with joystick in all directions? 0 Answers

2d or 3d for better perform on mobile devices? 1 Answer

Which is better? Switching out Textures or Instantiating Different prefabs? 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