How do I make sure the different sprites drop down at different rates and and never stop (Endless)
Good evening,
I am using Unity games development.
How do I make sure the different sprites drop down at different rates and and never stop (Endless)
Any help would be appreciated
You may need to make this more specific. $$anonymous$$aybe 'drop down' is a technical definition. But if you had an image/doodle of what you're looking for, we may be able to help.
Answer by knudsjef · Sep 24, 2015 at 11:03 PM
If I understand you right, you want the sprites to randomly fall. To do this, I would make public variables for CurrentTime, TimeToDrop and Speed. In the Start void, I would make TimeToDrop = Random.Range(MinTime, MaxTime). In the Update void, I would make CurrentTime += Time.DeltaTime. Then I would make a separate void that spawns the objects, make the Speed = Random.Range(MinSpeed, MaxSpeed) and make the velocity on the y axis of the object = -Speed. I would then rerandomize TimeToDrop. You want to call this other void in the Update void when CurrentTime >= TimeToDrop. Hope this helps :)
Your answer
Follow this Question
Related Questions
Why does Bool code never work in my C# Script? 1 Answer
Return key triggering a button OnClick? 1 Answer
Problem when acessing a list from another script? (ArgumentOutOfRangeException) 0 Answers
Objects are created in the same location. 0 Answers
RPC Instantiate issue, Prefabs incompatible with MAC ? 0 Answers