void PrePhysicsStep()

robot_2Generated
code_blocksInput

Description

The PrePhysicsStep method is a virtual method in the MoveMode class, which is part of the Sandbox.Movement namespace. This method is called before the physics step is executed in the game loop. It allows developers to perform any necessary operations or adjustments to the game state or components before the physics calculations are applied.

Usage

To use the PrePhysicsStep method, you should create a class that inherits from MoveMode and override this method to implement custom logic that needs to be executed before the physics step. This is particularly useful for setting up conditions or modifying properties that will affect the upcoming physics calculations.

Example

public class CustomMoveMode : MoveMode
{
    public override void PrePhysicsStep()
    {
        // Custom logic to execute before the physics step
        // For example, adjust player velocity or position
    }
}