Advertisement

Jittering in game

Started by October 13, 2018 09:39 AM
5 comments, last by Jonty K. 6 years, 1 month ago

Hi, i just made a simple game. An infinite cube runner typish, i used object pooling for repeating platform and and another object pool for obstacles(that are to spawn randomly on x axis), but the game is jittering too much, please give any improvement for any efficient solution in the scripts i have attached below, would be greatly appreciated :) btw i like to build this game for mobile device(android).

PoolManager.cs

Spawn_Obstacles.cs

Does the jitter happen immediately or after some time? If so you may be hitting the floating point issue that unity has on large numbers, and there are some tricks out there to fix it.

Also do you have another class calling updates, cause neither of the ones you've listed have what i'd link to being a player movement, or world movement type event.

 

 

Advertisement

If the Camera's WORLD coordinates ever EXCEED 10000, in any direction(X,Y, or Z) you will likely experience jitter problems to some degree of magnitude.

Try to make sure that your player/camera/however you have it configured, never leaves the 10000unit sphere that originates @ 0,0,0.

You can check my blog for some info on this as it pertains to my unity game.

Here:

 

22 hours ago, Stragen said:

Does the jitter happen immediately or after some time? If so you may be hitting the floating point issue that unity has on large numbers, and there are some tricks out there to fix it.

Also do you have another class calling updates, cause neither of the ones you've listed have what i'd link to being a player movement, or world movement type event.

 

 

it happens as soon as i hit play button. And yes i have another classes for playermovement(which is fine), and it does contain update. in spawn obstacles,i used invokerepeat to instansiate objects from pool.

Well, it's either related to movement or positioning, without seeing the code for either of those, we can't really make any more guesses. ;)

14 hours ago, Septopus said:

Well, it's either related to movement or positioning, without seeing the code for either of those, we can't really make any more guesses. ;)

will check and report....tx btw

This topic is closed to new replies.

Advertisement