- Home /
Problem is not reproducible or outdated
Character Controllers Knockback
...
Why do you get slamDirection as a local space direction, but then turn it into a world space direction before using it? why turn it into a local in the first place? do you use it as a local direction in some line not shown here?
Answer by Jason B · Dec 22, 2010 at 08:38 PM
Your mathematics are slightly complicated for the slam distance (that plus I suck at math :)) but it looks like when you're adding and subtracting those time values, it's getting added/subtracted from the vector as a whole, meaning the final movement will have force applied to all axises (mostly just the axis you want, but to a smaller degree, the other ones as well).
I may be wrong, but at a glance that's what it looks like.
Since your game is 2D (I think, right?) try specifying only the axis you intend the force to be applied on rather than the entire vector.