Monday, 17 November 2014

Another player mechanic will be the ability to climb walls. I have been working on this mechanic recently. There will be 3 types of climbing; one that requires you to jump to reach the edge, one where the edge is within reaching distance from standing, and one where you simply step up. So far, I have the jump climb and the non jump climb working but have not got the step up working yet.

The climbing system (for the jump climb) works like so:

When you are close to an edge, and you press the jump button, two raycasts are fired downwards (blue). One for each hand. These raycasts detect if you are close enough to wall to climb it. If you are then two positions, one for each hand are calculated at the intersecting point of the edge at the top of the wall (green).  The red spheres are the IK (inverse kinematics) positions for the hands.

Once all this is calculated, the exact force required to jump to the height required is calculated. You then begin to jump whilst also reaching  upwards for the edge. Once you are close enough, both hands then lock onto their targets, making it appear as if you are hanging.

Once you have reached the climbing height, the character will place his feet against the surface of the wall.

If jump is pressed again, you begin to climb. You let go of the edge when you're a certain distance from the edge. The leg animation is on a different layer to the arms therefore they work independently of each other. When either of your feet reach near to the edge point, it will trigger the exit climb animation and you begin to exit the climb...

Like so...

Then the climb is finished and normal movement is resumed.

For the final thing, there will be different animations on a different model so I will need to change some stuff to make it work with the final animations. The base system is in place so can be easily implemented later.

xoxoxo

0 comments:

Post a Comment