Hi! I’ve been working on my 2D game, and I’ve come across a bit of an obstacle. I really don’t have a good idea of how I would go about creating walljump mechanics for my game. Basically what I want it to do is (I only need help with the first two):
- Check if the player is “x” much above the ground
- Check if there is an object with the tag “wall” to the left or right of the player
- If both above conditions are true, change the animation to the wall sliding animation, and then modify the gravity (I can do this one, at least)
- If the player presses the jump key, then depending on what side he’s facing launch him into the air (I can also do this one really easily).
So, basically what I need help with are the first to conditions I listed above. I have no idea how to detect how far off the ground the player is, nor how to detect if there is an object to the left or right of it.
Thank you very much! I appreciate your help!