Ways to handle movement (test after building game):
* rb.velocity - applies speed, offers good control, need to use FixedUpdate() and set rb to RigidbodyInterpolation.Interpolate to avoid jittery (after building the game)
* rb.AddForce() - applies acceleration, which is bad for position based control
* transform.Translate() - used in Update() with Time.deltaTime, it creates smooth movement, but it has problems on collision
More notes about the velocity approach:
* according to the Unity docs, setting rb.velocity directly causes unrealistic movement
* however, in a game focusing on control pleasance, it doesn't matter
* I use cinamachine to follow the character, and it just follows smoothly
* I tried to use Vector3.SmoothDamp, but basically that's to make sure moving towards a target over time, so it's not solving the correct problem
I learnt form this video about how to avoid jittery:
• Fix RigidBody Jitter i...
Негізгі бет Unity - Prevent jittery when moving controlled characters
Пікірлер