How to turn off character controller?

I want my player character affected by physics force from enemy’s attack or spell.

But my character use Character Controller.

And use that in script. So I can’t remove it.

But then it can’t be affected by physics effect, right?

Then how to turn off when just hitted and affected(like knocked back) and then turn on again?

I tried like,

player.GetComponent(CharacterController).enabled = false;

but this does not work.

It doesn’t work like that, I tried, believe me, I tried…

What you have to do is replace your character with a copy (prefab) in exactly the same position and rotation while the physics happens.

Search for “Ragdoll” to get going.