- Home /
Character Controller - Got Hit and Flying Physic
Hi,
Let say that I have a Character Unit. When the unit got hit by a really strong attack, the Unit will got blown away toward the direction of the Attack Vector.
I wanted to do this via Calculated Physics rather than using preset Animations.
The issue is, my Unit is set up with CharacterController at the moment. Can CharacterController do something that can achieve this?
Or should I re-plan my workflow and set up CapsuleCollider and RigidBody instead?
Also, If I were to add CharacterController to the root, and add Rigid Body to the hip, is it possible to switch between them? Such as using CharacterController only in normal cases. And use rigidbody only when the character got blown away.
There was a few place that use CharacterController.Move, Does transform.translate take Physics Collider into Account?
THX in advance
With so little information about the game, the desired behavior, and the scripts you are using, any answer would be a guess. Given that you are using character controller, I'd lean towards simulating the physics in the CC script. If you explosion blows the character up in the air, and if the character stops when hitting the ground, then an explosion is just a jump with specific initial values. $$anonymous$$ost scripts that drive a CC already have jump code. An explosion that skitters the character across the ground is a bit more complicated since you have to suspend normal behaviors during the explosion but not that difficult.
You might post this question on Unity Forums. They are better designed (and more appropriate place) for discussion questions.