Apologies for the bad title -- I have no idea how to explain this problem succinctly.
I have two 3D vectors. One is the player's movement direction, and the other is the direction towards a wall they are climbing. I need to make it so when the player is moving towards or away from the wall, they are actually moving up and down. All while preserving the sideways movement as it would be without climbing.
I've tried to understand cross products and other vector maths, but I cannot figure this out. Thank you for any help you can provide.
Edit: an simple scenario for clarity (y = vertical):
Vector3 directionOfMovement = (1.0, 0.0, 0.0)
Vector3 directionTowardsWall = (1.0, 0.0, 0.0)
Vector3 myRequiredResult = (0.0, 1.0, 0.0)
I need it to work when the directions are at odd angles as well.