I’m trying to make a throwable object that is throwed by pressing a key. I have been reading a lot about this, but I see nothing but contradictory explanations…
What I want to do is apply a force in a single FixedUpdate cycle, so in the next ones the object would go on by itself.
So, do I need to use ForceMode.Force or ForceMode.Impulse? And also very important, does this force need to be multiplied by Time.deltaTime in any of this force modes?
I personally use rigidbody.AddForce for this sort of thing.
You can apply the force over one frame and the physics engine will automatically carry on the movement of the object.
So you could add force over a single frame - this also means that you shouldn’t have to worry about Time.deltaTime…
An example of using rigidbody.AddForce:
if(Input.GetMouseButtonDown(0))
{
ThrowObject.rigidbody.AddForce(Vector3(0, 0.5, 1) * 100);
}
Ofcourse the throw object will need a rigidbody component for this to work correctly.