I am trying to make a 2D platformer and I want the player to jump away from the wall when he does a wall jump. I recall during an FPS tutorial I did that there was some API function that allowed you to find the angle perpendicular to the surface you had collided with.
For instance, if you were to shoot the ground from any angle, it knew to animate the spark straight up away from the ground. Also, if you shot the wall, it knew to animate sideways away from the wall.
That FPS tutorial is not longer there so I’m not sure if that was one of the outdated functions. Any help will be greatly appreciated. I am using the character controller.
if (controller.collisionFlags == CollisionFlags.Sides) //if touching walls only
moveDirection.x = //away from the wall;
moveDirection.y = wallJumpSpeed;