Animations that interact with the enviroment

You want to do this with IK. In essence you fire line traces out in a few directions and place your IK effectors there.

There’s obviously a lot more to it than that if you want it to look polished but that should at least give you a starting point for your searches.