Endless game issue .

Hello Guys ,

i started a endless running game , in which player moves straight . After googling , i felt that i must move the world and player must be static. but , i have a little confusion. :confused:

I was planning to drop some stones from the side mountains on to the player . If my world moves , than for stones , the same movement rule apply ?? (both toward player with the world and downward from mountain) … if my stones are rigidbody acting under gravity , then what should i do in that situation ??

I am not quite sure why you are moving the entire world every frame instead of just moving the player and the dynamic objects, but if that is what you would like to do, there is an easy way to move the dynamic objects. You already have a Rigidbody attached to the dynamic objects, just call RigidBody.AddForce()

As a side note, only updating the dynamic object’s each frame (Player and stones) is less CPU intensive than moving all static objects and some dynamic objects. (Ground, Walls, stones, etc) In the event that you have many static objects, you will notice frame rate increase when only updating dynamic objects.