mirror of
https://github.com/godotengine/godot.git
synced 2025-01-18 20:40:57 +08:00
Merge pull request #51487 from nekomatata/fix-moving-platform-3d-snap
Fix 3D character snap on moving platforms
This commit is contained in:
commit
6cea7ebae4
@ -1176,11 +1176,6 @@ bool CharacterBody3D::move_and_slide() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!on_floor && !on_wall) {
|
||||
// Add last platform velocity when just left a moving platform.
|
||||
linear_velocity += current_floor_velocity;
|
||||
}
|
||||
|
||||
if (was_on_floor && snap != Vector3()) {
|
||||
// Apply snap.
|
||||
Transform3D gt = get_global_transform();
|
||||
@ -1213,6 +1208,11 @@ bool CharacterBody3D::move_and_slide() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!on_floor && !on_wall) {
|
||||
// Add last platform velocity when just left a moving platform.
|
||||
linear_velocity += current_floor_velocity;
|
||||
}
|
||||
|
||||
return motion_results.size() > 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user