mirror of
https://github.com/godotengine/godot.git
synced 2025-01-24 11:32:51 -05:00
Merge pull request #24046 from DualMatrix/stop_slope
Fixed using move_and_slide with stop_on_slope stopping too early
This commit is contained in:
commit
661e5e873b
1 changed files with 1 additions and 1 deletions
|
@ -1293,7 +1293,7 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const
|
||||||
if (p_stop_on_slope) {
|
if (p_stop_on_slope) {
|
||||||
if (Vector2() == lv_n + p_floor_direction) {
|
if (Vector2() == lv_n + p_floor_direction) {
|
||||||
Transform2D gt = get_global_transform();
|
Transform2D gt = get_global_transform();
|
||||||
gt.elements[2] -= collision.travel;
|
gt.elements[2] -= collision.travel.project(p_floor_direction.tangent());
|
||||||
set_global_transform(gt);
|
set_global_transform(gt);
|
||||||
return Vector2();
|
return Vector2();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue