- Home /
What is the best way to handle climbing / jumping?
I'm working on a third person controller and I'm having a real hard time handling climbing and jumping. So far I rely on mecanim for motion (I'm using the 'apply root motion' option) and raycasting to check for obstacles; that way, the character is able to climb even if the obstacle is a pile of boxes (so far I've used box colliders only), regardless of the amount of boxes, their rotation, etc. The thing is, the raycasting is not 100% effective (sometimes it passes through obstacles, sometimes it aims up and sometimes it aims down), target matching never worked and should the obstacle 'lean' towards the character (like this /. assuming the dot is the character) the raycasting simply fails (either by omitting the obstacle or wrong calculation of the obstacle height). I've seen some systems that rely on triggers for jumping and climbing, which is fine until you stack two or more boxes or rotate the obstacle (say, by pushing a box so that the top end up facing away from the character), issues that are avoided using raycast. Furthermore, the amount of control the player has over the jump is greatly hindered by the 'apply root motion' option; the height and length of the jump is determined by the animation/s played and not by the player input (as is the case with most FPS where there is some degree of 'air control'), thus making the problem of jumping over obstacles (or jumping to, on or from them) all the more difficult to handle. That being said, does anyone knows what is the best way to handle climbing and / or jumping? Is there any in-depth tutorial / documentation that may help?
Answer by rasheedqw · Sep 28, 2013 at 01:55 AM
I would use a trigger system put a trigger around the thing you want to climb so when your character hits it it plays the animation you could tag the object as climb so when your character hit anything called climb they will play the animation
Your answer
![](https://koobas.hobune.stream/wayback/20220613113330im_/https://answers.unity.com/themes/thub/images/avi.jpg)