How to get character to run into cover (third person shooter)

Hello there!

I’m looking for a good way for my character to get into cover.

  • Basically I have a box collision that
    if the player is on the edge of the
    box collision when i press the cover
    button the player will get into
    cover.
  • Unfortunately the player will fall
    short of the desired location of the
    cover, so I need they character to
    run up to the cover then when it hits
    the the cover such as a wall, the
    character will play the animation to
    get into cover.

Any help will be much appreciated!
Thank you!

Hi Scott!

Thank you very much for your answer!

If I understand correctly, you’re saying that when you press the cover button, the a sphere trace will be fired from the character, that trace will hit a bit of cover and that will give you the distance to the cover. So by getting the distance of your location and to the cover you can set some nodes to move the character to the location. Then when close enough to the location, set a bool to switch the animations?

rather than distance to cover, the trace gives the closest location you could stand in, right in front of the cover. you should switch the bool as soon as the trace detects cover. and after the first trace, you may need a few more traces to determine what kind of cover is in front of you, because vertical cover will probably have a different animation than chest high walls.