I’m trying to make a Endless Runner game!
My solution is make player stand and move the obstacles move!
I attack Riggidbody2D and BoxCollider for them and move by change velocity!
When i buid to mobile, it’s not quite smooth, still lags and hiccups !
I have applied Object Pooling technique!
Probably not the case, but I’ll mention it anyway: when I was working on an endless runner, I also had performance issues (hickups). In my case it was caused by my debug.log calls… When I removed them, it ran 100% smooth
Is it being done in update or fixed update? I had issues similar because I had movement in fixed update & other non movement stuff in update. When I moved everything into update & got rid of fixed update it smoothed out.
Each object had its own movement script which I put into update & removed from fixed update. That stopped them jitteriness a bit. I then did the same to the player & that fixed it.
In the end each object had its own update for their movement & the player had its own update for all of its movement. I had nothing left in fixed update. Mine wasn’t an endless runner though but it did involve every object needing physics so it could fall & be pushed properly when needed.
Unless you need physics for all of the objects you could remove the rigid bodies from them so only the player has one. Both at means less physics processing.