AddForce with direction not working??

I’m using this:

				Vector3 addforceDirection = hitObject.transform.position - Camera.main.transform.position;
				addforceDirection.normalized;

					hitObject.transform.rigidbody.AddRelativeForce (addforceDirection * blowback);

And the hitObject.transform.position that I’m hitting isn’t getting blown in the direction I want it to. It’s always just backards. No matter what I change he just flies backwards. I’ve tried AddForce and AddRelativeForce. What did I do wrong?

2 Answers

2

You are generating a world direction, but you are using a function that takes a local direction. Change ‘AddRelativeForce()’ to ‘AddForce()’.

Ok nevermind, this wasn’t the issue it’s just the animations my model has ends up making him clip inside himself. I just need more force added. Thanks anyways! Making it AddForce did help it