This question already has an answer here:
- Top Down RPG Movement w/ Correction? 4 answers
I am attempting to create an effect in a game that is identical to the effect I've shown in the attached gifs. Essentially, the character, when they are running or walking and hit an object that is stationary, if it's possible, (meaning there is a valid path for continuation) they should glance off the side of said object and keep going.
In this first GIF I am only holding the
UP directional key, notice how the character glances to their right:
In this second GIF I am only holding the
DOWN directional key, notice how the character glances to their left:
In this third GIF I am only holding the
UP directional key, notice how the character glance first to their left and then to their right:
Could someone describe the process that I would need to follow in order to do this type of collision detection into redirection?