Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 3.31 KB

IFixedUpdate.FixedUpdate().md

File metadata and controls

12 lines (11 loc) · 3.31 KB

IFixedUpdate.FixedUpdate() Method

Frame-rate independent FixedUpdate() message for physics calculations.

void FixedUpdate();

Remarks

FixedUpdate() has the frequency of the physics system; it is called every fixed frame-rate frame. Compute UnityEngine.Physics system calculations after FixedUpdate(). 0.02 seconds (50 calls per second) is the default time between calls. Use UnityEngine.Time.fixedDeltaTime to access this value. Alter it by setting it to your preferred value within a script, or, navigate to Edit > Settings > Time > Fixed Timestep and set it there. The FixedUpdate() frequency is more or less than Update(). If the application runs at 25 frames per second (fps), Unity calls it approximately twice per frame, Alternatively, 100 fps causes approximately two rendering frames with one FixedUpdate(). Control the required frame rate and Fixed Timestep rate from Time settings. Use UnityEngine.Application.targetFrameRate to set the frame rate. Use FixedUpdate() when using UnityEngine.Rigidbody. Set a force to a UnityEngine.Rigidbody and it applies each fixed frame. FixedUpdate() occurs at a measured time step that typically does not coincide with Update(). In order to get the elapsed time since last call to Update(), use UnityEngine.Time.deltaTime. This function is only called if the UnityEngine.Behaviour is enabled. Override this function in order to provide your UnityEngine.Component's functionality.

See Also