Hello, I’m trying to create weapon recoil for a project I’m working on and I’ve got a few questions about it.
Is animation or Rigidbody.AddForce() better for creating recoil? I would think using the AddForce() method could result in a more natural look/feel so I’m going to base my next few questions on that.
What I was thinking of doing was using AddForce to push the weapon up/back, and then a Vector3.Lerp() to smoothly bring the weapon back to its original position.
I’ve tried using AddForce but it seems the velocity doesn’t decay but rather just keeps what I added.
I’ve also looked at AddExplosionForce() since that seems like it would be a good way to launch the weapon up/back a little w/o adding permanent velocity.
And last question for now. What about setting a pivot point on a GameObject? How could I have the pivot point on the GameObject unaffected by Y forces, but still react to a little Z force, and have the front of the weapon react to both.
Also, I’ve heard of HingeJoints, and Springs. Should I be looking at those?
Thanks, and sorry for the long post!