How to stop the character's movement after collision?


So this is my 2D game setup and I followed this tutorial-> Unreal Engine 4 2D Game Creation with Paper2D Part 1 - Introduction and Importing Assets - YouTube
I want my gravity to be 4 directional so I used this method->

So when the gravity works in X-Axis(right direction), the pink box collides with the black plank and stops. But when the gravity works on Z-Axis(up direction), the pink box collides and stops for fraction of seconds and it crosses the plank, that is, it rolls around the black plank above and keeps on moving towards that direction. How do I keep it stationary after collision?
I’m a total noob so can’t find a way to do so.