Restrict movement within the volume

I made it. but the character stopped having that constant movement. when i let go of the keyboard it stops moving

captura1
captura2
captura3