Lock backwards movement

Hello,
I have a scenario where the user controls a ball in upwards and downwards direction, however, sometimes the ball might hit the edge of an object (cube) and push the ball backwards, I dont want that, I only want the ball to move forward and then the user controls upwards and downards direction.
How can I stop the ball from bouncing backwards when hitting the edge of the object.
Thanks

What do you want it to do then?

I figured it out no worries!