- Home /
Vaulting Over Ledges
Hey all,
Im sure what im looking for is fairly simple but im stuffed if I know how to do it...I am fairly new to coding. Oh and can any scripts please be in javascript. I am also only using unity basic.
Now I want to edit the firstpersoncontroller so that when I run up to a wall holding a certain button and make contact with it I 'vault' over it. This would give the player a small boost of speed (brought back to normal by friction). Oh and the character needs to go up and over the wall (small jump action?)
It'll probably be a box collider with a trigger event that I attach to walls you can 'vault'.
Any help would be greately appreciated.
Regards,
Riley Morse
Thanks $$anonymous$$eltdown that after some research last night that was the impression I was left with (or using the extraforce on the jump in some way).
Probem is i don't know how to apply it to the allready existing firstpersoncontroller. Any tips on doing that? or a tutorial I can read?
Answer by demize2010 · May 23, 2011 at 11:46 AM
Hey man this is possibly more complicated then you think.
You will need a character model with a vault animation and possibly a compund collider depending on how you do this. The compound collider is the methrod we used as then clearing the object was purley animation based. You will need a custom character motor / controller which uses a rigidbody for this to work.
I think you can roughly get the result you want using the stock character controller by adding an upwards force/transition and playing the vault animation. You may have to set the capsule collider to run down the z-axis as well depending on your animation.
Without a HumanIK solution you're going to struggle to get really, really good looking results but you can fake quite a bit if you're clever.
Answer by Meltdown · May 23, 2011 at 12:22 PM
transform.position does not affect gravity/momentum.
I'd suggest using rigidbody.AddForce to do what you want to do. I assume your camera is your player since it is a first person game. Simply add the force to your camera in the direction you want the player to go to vault the wall.
Your answer