How to make the player smoothly move around the terrain in the game?

alt text

I am making an isometric game. When a player tries to diagonally go into a wall, I want them to slide smoothly along it, so any part of the movement will be legal, and anything in the normal direction is thrown out. Walls can be of any angle, not just vertical or horizontal, and the player can have 360.

It seems to me that I'm almost there, but I can not put the last part in place.

+3
source share
1 answer

I believe that you want to project an input direction parallel to the wall.

Vector Projection will be a way to do this.

, , . , .

+4

Source: https://habr.com/ru/post/1766262/


All Articles