0
\$\begingroup\$

I have a third person character and I want to make it wall run. However since there will be a wall run animation, I don't want the player to do the Inputs for a wallrun and at the end change direction with touching the wall. I don't want the animation to start but have the player not wall run. I also don't want to start the animation right when the player start the wall run since I want a transition. What would be a good way to be sure the player will wall run ? Would having an input forcing the character to wall run be a good solution ? I don't want to controls to be too complicated, so would there be a better solution ?

\$\endgroup\$
0
\$\begingroup\$

If the player makes an input that can result in a wall run, use a ray cast to find a viable wall, if any. If there isn't a wall, don't transition into a wall run... But if there is, play the transition animation, while interpolating the character to the wall for the same duration. Then the character can wall run.

You are going to have other challenges. In particular what happens when the character wall runs into a corner. Either on the inside or outside of a corner. You will have to decide if you transition the wall run to follow the wall or not.

So you will have a ray cast to check if the character reached the end of the wall (or perhaps the outside of a corner). And perhaps another to check for the inside of a corner, depending if that is something you want as part of the mechanic.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.