Hey guys,
I am moving a gameobject manually and it is jittering.
Extra Details
-I am running at around 60fps.
-I have tried all combinations of LateUpdate, FixedUpdate, etc. It doesn’t make any difference.
-I am not using any Unity physics at all. No rigid bodies, nothing.
-If I turn off VSync I skyrocket to 1000fps and it looks a bit smoother, but that is not a solution since the end product will definitely not run at 1000fps, 60 fps is what I’ll get if I’m lucky.
Here’s the code:
float elapsedTime = Time.time - _moveStartTime;
gameObject.transform.position = Vector3.Lerp(_moveStartPos, _wayPoint, elapsedTime/_moveTime);
vars:
_moveStartTime is just set to Time.time when it’s ordered to move.
_moveStartPos is where the gameobject started.
_wayPoint is where it’s going.
_moveTime is the total time in seconds that it will take to get there.
It is just one gameobject moving across the screen, there is literally nothing else.
This same method has worked with 100% smooth results in many other languages / engines (such as AS3 with Flash, C++ with popcap developer framework).
I’m quite frustrated at this problem since it is a very simple thing I am trying to achieve, your help is greatly appreciated!