void FixedUpdate() {
float newManeuver = Mathf.MoveTowards(rb.velocity.x, targetManeuver, Time.deltaTime * smoothing);
rb.velocity = new Vector3(newManeuver, 0.0f, currentSpeed);
…
}
I know “Time.deltaTime” is the time between last two “Update()”.
Then why that code used “Time.deltaTime” in “FixedUpdate()”?
I know we use “Time.deltaTime” if we need to move something like kinematic with constant speed in “Update()”.
(like “transform.position += const_velocity * Time.deltaTime”)
Of course, we use “Time.deltaTime” with “Mathf.MoveTowards()” or “Mathf.Lerp()” for smooth moving.
But I think it is also natural in “Update()”.
In my test, FPS is about 110~120 with large variation.
Anyway, “FixedUpdate()” is called 50 times per second.
If there are 30fps and 120fps games, acceleration(=increase of velocity) of 30fps game is greater than 120fps game’s. I think using constant like 1/120 is better than this.
I think “Time.deltaTime” is meaningless in “FixedUpdate()”.
Is it just because the game is simple game and we cannot recognize the difference?