Timeline for Generate platforms and move them with same speed
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 10, 2015 at 13:56 | vote | accept | SanSolo | ||
May 10, 2015 at 12:51 | comment | added | DanoThom | Sounds like a plan. A lot of endless runners use recycled, staggered scenery + object prefabs. If you keep 3 running in a row and just recycle the beginning and end ones you'll give the illusion of a continuous scene. | |
May 10, 2015 at 10:23 | comment | added | SanSolo | I've tried that too, things fall apart after certain speed. But you mentioned Object pooling. Now i'm thinking, i create a holder object and add some pillars to it at varying distances. Then, make a prefab out of this. Create a few prefabs of this kind and keep positioning them. But challenge is to position the moving targets immediately one after the other so there's no gap between them. | |
May 10, 2015 at 10:18 | comment | added | DanoThom | I think you're overcomplicating this a bit. Just have 1 single global velocity value. Increase or decrease this global value whenever you want to change the speed of all the pillars. When you instantiate a pillar it sets it's starting velocity to the global value. | |
May 10, 2015 at 10:08 | comment | added | SanSolo | Because this method adds force after instantiating. Say p1 is initialized and added force x1. Next p2 is initialized with force x1+delta. they will each have different speeds now. | |
May 10, 2015 at 9:27 | comment | added | DanoThom | Why will they each have a different speed? You either all give them a uniform speed which you can increase or decrease globally, or you allow them to alter their own speeds (which it sounds like you don't want). I'm unclear of your overall objectives now so not exactly sure what you're attempting to solve. Why don't you post an edit of some points of what exactly you're trying to achieve. | |
May 10, 2015 at 7:45 | comment | added | SanSolo | Problem here is, each of will have different speed. I want all pillars to move with same speed so the distance between them is maintained | |
May 8, 2015 at 15:29 | comment | added | DanoThom | You could use Unity Layers to better manage your collision tests with other pillars in the OnCollisionEnter. You could also use RigidBody2D.MovePosition I guess although then it might not generate all the needed physics collisions with your players etc. | |
May 8, 2015 at 12:59 | comment | added | SanSolo | Cannot use AddForce. It might cause pillars to collide with each other. Object pooling is definitely something i should be doing. Thanks. | |
May 8, 2015 at 12:16 | history | edited | DanoThom | CC BY-SA 3.0 |
additional info
|
May 8, 2015 at 12:08 | history | answered | DanoThom | CC BY-SA 3.0 |