Applied physics force from animations.
A number of my animated enemies are applying excessive force, as in the type that cause game errors. Their attached weapons require rigid bodies in order to grab velocity for the damage routine. I can cap the damage just fine, but the application of the ridiculous force is still an issue. What methodology do I use for capping this force, or what can I do to make the weapons act like they would normally if they were just moving from something like addForce(). ? Weapons are attached to an animation, it is set to animate physics, thought he same result occurs with or without this. Thanks guys and gals.
Just to add some more information. I have searched this to death without any luck. The added weapon is locked down in constraints. The object being sent flying into la la land has a simple speed limiter, capping it's velocity.normalized at 255. This is called now twice in update and fixed update. The issue only occurs when the player character is hit by the weapon attached to animated enemy, i.e. an axe being swung.
The enemy, phys applied animation, single collider and rigidbody, same for the weapon, which is attached as a child to the animated object.
it's set to child so that it can be animated with the enemy, as doing otherwise causes it to flail around with see$$anonymous$$gly random rotations.
This is the last thing I really have to work on before starting levels and adding goodies, it would be super appreciated if someone could point me in the right direction.
got the same issue here, and also no luck on finding any answers. maybe it uses the mass of the kinematic rigidbody? I didn't test that though. make sure that the animator is set to animate physics, and interpolate the rigidbody, with continuous collision detection. elsewise you risk "jumping" colliders, intersecting with each other, and causing physics glitches
The simplest and most efficient way I could think of to avoid this problem altogether, is changing the fast moving collider to trigger mode, and do the calculation in script and add a hit force to the collided rigidbody.
Your answer
Follow this Question
Related Questions
Falling Platform 1 Answer
Bouncy Ball stops without enough force 0 Answers
[2D] Velocity increases faster after large force is applied. 0 Answers
Rigidbody.velocity Movement code produce wildly different gravity interactions 0 Answers
Why Does Bounciness Affects Rigidbody Velocity? (SOLVED) 0 Answers