aboutsummaryrefslogtreecommitdiff
path: root/scene/2d/physics_body_2d.cpp
diff options
context:
space:
mode:
authorFerenc Arn2017-03-31 10:25:09 -0500
committerFerenc Arn2017-04-03 10:02:12 -0500
commit1a620bd5faebd83015182ea032f40936a9916af6 (patch)
treee1705e3805bae8cb898694136f65d7622dd2bc8c /scene/2d/physics_body_2d.cpp
parent6731924dcfa7451d8b31461b438fd2a5aa8af1f6 (diff)
downloadgodot-1a620bd5faebd83015182ea032f40936a9916af6.tar.gz
godot-1a620bd5faebd83015182ea032f40936a9916af6.tar.zst
godot-1a620bd5faebd83015182ea032f40936a9916af6.zip
Diffstat (limited to 'scene/2d/physics_body_2d.cpp')
-rw-r--r--scene/2d/physics_body_2d.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 88845a729..f820c955a 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -1205,8 +1205,9 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2 &p_linear_velocity, const
}
}
- motion = get_collision_normal().slide(motion);
- lv = get_collision_normal().slide(lv);
+ Vector2 n = get_collision_normal();
+ motion = motion.slide(n);
+ lv = lv.slide(n);
Variant collider = _get_collider();
if (collider.get_type() != Variant::NIL) {
move_and_slide_colliders.push_back(collider);