- Home /
Question by
ajching · Feb 19, 2017 at 10:48 PM ·
unity 2dgravityplatformer
Unity2d Walking off platform throws off gravity
Does anybody know why moving a character with the following line:
rgb.AddForce(Vector2.right direction play.getSpeed(), ForceMode2D.Impulse);
where direction is just 1 or -1 and play.getSpeed() is 3f, would make it so that when I walk off a platform, the gravity doesn't appear to work until I either stop walking or change direction?
Like if I'm holding down the left button and continue off the platform, the player will fly off and it's almost as if gravity starts moving horizontally...but it works if you walk off and stop pressing, or if you just jump off.
Comment