mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 22:23:04 +00:00
Implemented the same change in CharacterBody2D
This commit is contained in:
parent
91409f518d
commit
88c7bc28b7
@ -352,14 +352,12 @@ void CharacterBody2D::_apply_floor_snap(bool p_wall_as_floor) {
|
||||
floor_normal = result.collision_normal;
|
||||
_set_platform_data(result);
|
||||
|
||||
if (floor_stop_on_slope) {
|
||||
// move and collide may stray the object a bit because of pre un-stucking,
|
||||
// so only ensure that motion happens on floor direction in this case.
|
||||
if (result.travel.length() > margin) {
|
||||
result.travel = up_direction * up_direction.dot(result.travel);
|
||||
} else {
|
||||
result.travel = Vector2();
|
||||
}
|
||||
// move and collide may stray the object a bit because of pre un-stucking,
|
||||
// so only ensure that motion happens on floor direction in this case.
|
||||
if (result.travel.length() > margin) {
|
||||
result.travel = up_direction * up_direction.dot(result.travel);
|
||||
} else {
|
||||
result.travel = Vector2();
|
||||
}
|
||||
|
||||
parameters.from.columns[2] += result.travel;
|
||||
|
Loading…
Reference in New Issue
Block a user