Godot Version
v4.5.1.stable.official [f62fdbde1]
Question
It looks like the object occasionally moves a little bit forward of the destination and then snap backward a little further than correct position and then snap back again to the correct position.
There are no physics process or camera movement at all.
extends Node3D
var velocity := Vector3.ZERO
var speed := 10.0
var acceleration := 10.0
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var movement := Vector3(Input.get_axis("move_left","move_right"), 0, Input.get_axis("move_up", "move_down")).normalized()
velocity = velocity.move_toward(movement * speed, acceleration*delta)
position += velocity * delta
# position += movement*delta*speed # this code replacing previous line also gives similar issues
Why is this happening?
UPDATE:
Suddenly, it doesn’t happen anymore. I barely touched the movement code, I only added rotation code, after I added the rotation code the jitter still happen, it even happened to the rotation. Then I went to toilet and suddenly it doesn’t happen.
UPDATE:
Nevermind, it still happened, but less frequently.