> For the complete documentation index, see [llms.txt](https://axongenesis.gitbook.io/timeflow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axongenesis.gitbook.io/timeflow/reference/samples/physics.md).

# Physics

Animate objects using physics and forces

Timeflow can animate the position, rotation, or forces on Rigidbody components. See the example scene in Timeflow/Examples/Scenes/Animation/Physics

{% hint style="warning" %}
Please be aware that physics does not calculate in edit mode so you must enter play mode to see the results. When animating position and rotation, Timeflow animates the transforms directly in edit mode so that you have a preview, but at runtime it uses [Rigidbody.MovePosition](https://docs.unity3d.com/ScriptReference/Rigidbody.MovePosition.html), [MoveRotation](https://docs.unity3d.com/ScriptReference/Rigidbody.MoveRotation.html), and [AddForce](https://docs.unity3d.com/ScriptReference/Rigidbody.AddForce.html).
{% endhint %}

{% hint style="info" %}
**Gravity**

You may wish to disable gravity on objects animated with Timeflow, otherwise objects will fall by the force of gravity accordingly.
{% endhint %}

## Rigidbody Properties

To animate an object using physics, select one of the following properties, listed in the context menu under Rigidbody. This menu also displays the built-in parameters of the Rigidbody component, however to ensure proper transform updates select one of the following.&#x20;

```
MovePosition
MoveRotation
AddForce
AddAcceleration
AddImpulse
AddVelocityChange
```

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2Fymtaps5SxXuFXWDCWzzs%2Fimage.png?alt=media&amp;token=a51fc998-4f38-452c-800b-8e3588b3d5a6" alt=""><figcaption></figcaption></figure>

Apart from MovePosition and MoveRotation, all others are applied via Rigidbody.AddForce. Please refer to the Unity documentation on forces and ForceModes.

<https://docs.unity3d.com/ScriptReference/Rigidbody.AddForce.html>

## Fixed Update

Whenever animating a rigidbody component, it is highly recommended to change the update settings on the behavior to [Fixed Update](/timeflow/user-guide/timeflow-editor/update-settings.md#fixed-update). This applies updates according to the physics framerate and not only improves performance but ensures that movements are applied correctly.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2Fp7DM6RtcCsl4xk1o4I6E%2Fimage.png?alt=media&amp;token=3067c27c-2725-4045-849a-5018d2ccfe66" alt=""><figcaption></figcaption></figure>
