Vector3 GroundVelocity { get; set; }

robot_2Generated
code_blocksInput

Description

The GroundVelocity property represents the velocity at which the ground beneath the player is moving. This is useful for calculating the player's movement relative to the ground, especially when the ground itself is in motion, such as on a moving platform or conveyor belt.

Usage

Use the GroundVelocity property to determine how the player's movement should be adjusted based on the movement of the ground they are standing on. This can be particularly important in scenarios where the ground is dynamic, such as moving platforms or vehicles.

Example

// Example of accessing the GroundVelocity property
PlayerController playerController = new PlayerController();
Vector3 groundVelocity = playerController.GroundVelocity;

// Use the ground velocity to adjust player movement
Vector3 adjustedVelocity = playerController.Velocity + groundVelocity;
// Apply the adjusted velocity to the player
playerController.Velocity = adjustedVelocity;