Addforce to a Navmesh Agent
Hey,
I'm fairly new to Unity 3D. Currently I`m working on a small VR sword fighting game. A enemy should follow (as a Navmesh Agent) and attack me once his trigger detects my collision box. This works fine. I'm controlling a sword with my motion controller and once the enemies collision box detects a gameObject with the tag "Weapon" (my sword), it should should set the bool IsHit in the Animation Controller to true (which should play the "hit" animation (that works)) and It should apply a force to the enemies rigidbody to toss him in the direction where I toss my sword. That works also, but as soon as my script applied the force, the Navmesh Agent of the enemy doesn't work anymore. It doesn't follow me anymore, it's rotating in random directions, is moving either in a wrong direction or isn't moving at all.
How can I fix that problem?
Posted May 1, 2017, 11:41 AM UTC