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 DubstepDragon · Mar 01, 2014 at 03:17 PM · c#gamemusic

About to start a new project, need help...

I am about to begin developing a rythm-based game for Android and iOS. It involves a lot of things happening at set amounts of time. Now, the only knowledge I have for programming with time is by the use of coroutines. But I am not going to use about 60 coroutines per level, which will suck, never mind being inefficient. So my question is...

How can I have a single GameObject, at the very right of the screen, that will instantiate objects every set amount of time? Can this be dynamic, for example, instantiate GameObject "A" every 2 seconds for 8 seconds, then instantiate GameObject "B" every 4 seconds for 8 seconds?

The help I receive now will determine my future success. Thank you all so much :D

Oh and just as a side-note, I only have experience with C#, not JavaScript, however I can convert the scripts if they were not too complex.

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

1 Reply

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

Answer by robertbu · Mar 01, 2014 at 03:36 PM

There are a lot of different ways to do what you want, and there are too few details of your game for a recommendation. From this limited context, I'd probably use a language for each event either entered in a text file or in an array of string in the inspector. The lines could look like:

 A,2
 A,2
 A,2
 A,2
 B,4
 B,4

Then you simply parse the string, Instantiate the object specified (or get it from a pool), and wait the time specified.

But there is an underlying issue of synchronization. I'm guessing that you want to synchronize your game object to the music. I'd be very concerned about how Unity's timing matched up with the music playing speed. I know there have been posts on the issue.

Perhaps you need to describe your game more fully in a design question on Unity Forums.

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 DubstepDragon · Mar 01, 2014 at 04:05 PM 0
Share

Well, that seems to clear things up :D

Please convert your comment to an answer so I can accept it :D

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

20 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

Related Questions

Unity: C#: Eyes look at mouse: HELP!! 3 Answers

Changing gravity direction... 5 Answers

Distribute terrain in zones 3 Answers

C# Fourier transform rhytm game implementation? 1 Answer

Multiple Cars not working 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