Hi.
I would have a fsms with 2 raycasts.
1 forward to detect walls (and store bool result)
1 downward (a bit in front) to detect floor.
Then on another fsm use 2x 'Fsm Bool Test' and set every frame (found on
Ecosystem)
on same state where you do the movement.
Then when wall is true or floor is false turn image (for example scale to -1)
and move to the other direction.