๐Physics
Animate objects using physics and forces
Last updated
Animate objects using physics and forces
Last updated
Timeflow can animate the position, rotation, or forces on Rigidbody components. See the example scene in Timeflow/Examples/Scenes/Animation/Physics
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, MoveRotation, and AddForce.
Gravity
You may wish to disable gravity on objects animated with Timeflow, otherwise objects will fall by the force of gravity accordingly.
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.
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
Whenever animating a rigidbody component, it is highly recommended to change the update settings on the behavior to Fixed Update. This applies updates according to the physics framerate and not only improves performance but ensures that movements are applied correctly.