Pacman movement in 3D world

I was following this video tutorial (which contains 3 games, this is the 3rd one)

video link:
If you watch the video at 2:40:20 (Pacman Preview) this is supposedly the end result of the game, the tutor in this video tries to 2Dify a 3D Pacman (I’m assuming that’s because of the Nav Mesh that will be used in the tutorial). The problem I’m trying to solve is, notice how in the movement in the preview, it’s kind of different from the Pacman we know. The difference is that in the pacman we know, if you attempt to change direction to a direction that is already blocked, pacman just keeps going at the old direction (doesn’t change), but in this preview pacman just moves freely with absolutly no constraints, resulting in some turn offs that you can see yourselves in the preview

What would you suggest I do to solve this problem?, I thought of raycasting but I just have a feeling that it’ll mess something up with the movement, + I’m still a newbie in ue4 so I don’t have much experience that would allow me to easily come up with a solution

Thank you in advance