Fix CharacterBody3D get_position_delta()

Calculate the difference of global positions.
This also fixes get_real_velocity().
This commit is contained in:
Ricardo Buring 2023-06-26 22:48:41 +02:00
parent 1f9e540f14
commit 104da478a8
1 changed files with 1 additions and 1 deletions

View File

@ -1780,7 +1780,7 @@ const Vector3 &CharacterBody3D::get_last_motion() const {
}
Vector3 CharacterBody3D::get_position_delta() const {
return get_transform().origin - previous_position;
return get_global_transform().origin - previous_position;
}
const Vector3 &CharacterBody3D::get_real_velocity() const {