Im making a 3d game on a 2d plain, i have a moving character who can jump but im looking for a wall jump stlye script. But i am a terrible at code the best i can do is figure out wrong syntax so i was wondering if any one could point me in the right direction on how to make one?
asked Jan 01 '11 at 01:52 PM
sorry, but You're going to have to code it. There's really no way around learning to code in unity.. Thankfully however, it's an amazingly easy way to start learning how to code.
my first (and verryyyy hacky) project, "I am the night", (http://www.greenergrassgames.com/iamthenight) used wall jump this way:
first of all, i used a switch in my code to build a state machine to track the player's current state (grounded, airborne, wallsliding)
the character had a box colider that stuck out in front of him a tiny bit, and that followed him around. this was set to "use trigger". if this trigger object ran into an object tagged as "wall" while the character was in his "airborne" state, AND the player pressed against or away from the wall with his arrow keys, the character would enter a "wallsliding" state -- where he quickly flips around 180 degrees, plays a "i'm sliding down a wall" animation and falls down vertically very slowly. if the user hits jump in this state, the character springs away from the wall with a simple add force function and plays a wall-jump animation. he then goes into the airborne state, ready to hit another wall.
hope that isn't too confusing. there are probably better ways to do it.
answered Jan 01 '11 at 06:58 PM
If you want him to "Climb" over the wall, your going to have to animate it...
But you might want to define: wall jump.
Happy new years, and hope this helps =).
answered Jan 01 '11 at 05:10 PM