diff --git a/Player.gd b/Player.gd index 0e1efb0..abdf836 100644 --- a/Player.gd +++ b/Player.gd @@ -34,6 +34,11 @@ func _ready(): Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) +func _process(delta): + # Do this on the render tick so it doesnt jitter at higher FPS + _ball.global_position = _camera.global_position - _camera.global_transform.basis.z * 2.0 + + func _physics_process(delta): # Shamelessly stolen code from quake :) @@ -89,8 +94,6 @@ func _physics_process(delta): velocity = vel move_and_slide() - _ball.global_position = _camera.global_position - _camera.global_transform.basis.z * 2.0 - func _apply_friction(vel: Vector3, delta: float): var speed = sqrt(vel.x ** 2 + vel.z ** 2) if(speed == 0.0): return vel