Fix global_position for KinematicBody3DAgent (#52)

Use `global_transform.origin` instead of `global_position`
This commit is contained in:
volzhs 2021-06-08 12:24:36 +09:00 committed by GitHub
parent 49cc6ef696
commit 5b5ca11b03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,7 @@ func _apply_position_steering(accel: Vector3, delta: float) -> void:
velocity = velocity.linear_interpolate(
Vector3.ZERO, linear_drag_percentage
)
_body.global_position += velocity * delta
_body.global_transform.origin += velocity * delta
if calculate_velocities:
linear_velocity = velocity