Flors and walls

Hi!
I wonder how I will make a flor and a wall function that make my charakter don’t walk pass the flor and the wall.
I got no ideas how to do that.

Thanks Albert