From f9a988dd7b7fead8fb80f034df0075daa81e5237 Mon Sep 17 00:00:00 2001 From: Abdullah Hashim Date: Sat, 11 Jan 2020 01:35:37 +0300 Subject: [PATCH] Fix walking from slop to wall bounce issue this will fix the issue for most speeds but you need to modify environment check distance to 0.1f to make it work better thanks to @Stevepunk --- Assets/PC2D/Scripts/PlatformerMotor2D.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/PC2D/Scripts/PlatformerMotor2D.cs b/Assets/PC2D/Scripts/PlatformerMotor2D.cs index 7dc8541d..9f5339ec 100644 --- a/Assets/PC2D/Scripts/PlatformerMotor2D.cs +++ b/Assets/PC2D/Scripts/PlatformerMotor2D.cs @@ -2564,7 +2564,14 @@ private void ApplyMovement() _velocity.x > 0 && _collidedNormals[DIRECTION_RIGHT] == Vector2.left) { - _velocity.x = 0; + if (IsGrounded()) + { + velocity = Vector2.zero; + } + else + { + _velocity.x = 0; + } } if (IsGrounded() &&