# How to knock animated character backward when sword strikes wall

I was wondering how to make animation and physics interact.

Specifically, I want to make it so when my character (rigidbody) plays a sword hit animation (swinging the sword in front of it), it makes the character move backward when the sword and the wall collide.

I want this to happen with physics. When the sword pushes against the wall, It pushed the player back because of the rigidbody.

I've been looking at Animation rigging in unity. Would it work to add à collider to my sword and the use Inverse kinematic to move it ? How can I achieve this?

3. Create a script with:

void OnTriggerEnter () {
if (other.gameObject.CompareTag("Wall")) {