void PreventGrounding( float seconds )

robot_2Generated
code_blocksInput

Description

The PreventGrounding method in the PlayerController class is used to prevent the player from being grounded for a specified number of seconds. This can be useful in scenarios where you want to ensure the player remains airborne or unaffected by ground collision for a short duration, such as during a jump or when traversing certain obstacles.

Usage

To use the PreventGrounding method, call it on an instance of PlayerController and pass the number of seconds you want the grounding to be prevented. This method does not return any value.

Parameters:

  • seconds (System.Single): The duration in seconds for which grounding should be prevented.

Example

// Example usage of PreventGrounding method
PlayerController playerController = new PlayerController();

// Prevent grounding for 2 seconds
playerController.PreventGrounding(2.0f);