So, I’m working on a game where the majority of the fighting is done through melee combat. The thing is, the player is controlling a bear, and the attack animation doesn’t actually connect with the enemy AI.
The way I’m envisioning it working in theory is this:
So the player triggers the attack, which then results in a sweep in front of the player. If the enemy is caught in the sweep, some damage and directional velocity/knockback should be applied. On top of that, if the enemy dies as a result of the attack, it should also ragdoll.
What I’ve done right now is that I’ve attached a stretched cube (“plank”) to the paw of the bear, with a box collision that is enabled only when the attack is triggered.
I can successfully use it to apply damage and “kill” the enemy and make it ragdoll by simulating physics on the mesh. However, the main issue I’m having is that I’m not entirely sure how to apply directional velocity to the enemy with this method.
I’m thinking line traces would be the way to go here, but my knowledge on line traces is very limited, so I don’t exactly know how I would go about that in this scenario.
Any suggestions are appreciated.