x


ForceMode.Acceleration estimated dst != covered dst with a single Addforce in effect

ForceMode.Acceleration: " In this mode, the unit of the force parameter is applied to the rigidbody as distance/time^2. "

For me this means that F = distance/time^2 and since I used no other forces, useGravity is off, drag is 0 there can't be other forces affecting the object.

my code:

void Start () {
    Vector3 force = new Vector3(X, 0);
    Invoke("Break", time);
}

void FixedUpdate () {
    AddForce(force, ForceMode.Acceleration);
}

void Break () {
    Debug.Log("break")
    Debug.Break();
}

Still if I replace the letters with my values 10 = 45,9/3^2(45,9 is the distance the simulation got me) it's not right. Distance should be 90. So what could have held my object back? What am I missing?

{driven crazy(in a funny way) by meddling with physics in unity3d}

more ▼

asked Oct 09 '10 at 12:30 PM

matyicsapo gravatar image

matyicsapo
659 12 15 27

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The unit is distance/time^2 or better (distance/time)/time, i.e. velocity changed over time.

If you apply a force of 10 units over 3 seconds using ForceMode.Acceleration, then your rigidbody will be accelerated by 10 units/second per second. It will start out with 0 u/s and end up at 30 u/s at the end of those three seconds. This will give an average velocity of 15 u/s and result in the 45 units you measured (3 s * 15 u/s).

ForceMode.Acceleration and ForceMode.Force depend on how long a physics frame is. If the physics frame is ver long, much more force/velocity will be applied in that frame in compared to a short frame. In contrast, ForceMode.VelocityChange and ForceMode.Impulse do not depend on the frame time and will apply the force/velocity directly, meaning the actual force will change depending on your physics frame rate.

more ▼

answered Aug 23 '11 at 04:56 PM

Adrian gravatar image

Adrian
136 1 1 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1882
x292
x212
x64
x35

asked: Oct 09 '10 at 12:30 PM

Seen: 1348 times

Last Updated: Aug 23 '11 at 04:56 PM