void OnJumped()

book_4_sparkGenerated
code_blocksInput

Description

The OnJumped method is a public instance method of the PlayerController class in the Sandbox framework. This method is called when the player character successfully performs a jump action. It is marked with the Rpc/BroadcastAttribute, indicating that it is intended to be broadcasted across the network, allowing for synchronized behavior in multiplayer environments.

Usage

To use the OnJumped method, ensure that your player character is controlled by a PlayerController instance. This method is typically invoked internally by the PlayerController when a jump action is detected. You can override this method in a derived class to implement custom behavior that should occur when the player jumps, such as playing a sound effect or triggering an animation.

Example

public class MyPlayerController : PlayerController
{
    public override void OnJumped()
    {
        base.OnJumped();
        // Custom behavior when the player jumps
        PlayJumpSound();
        TriggerJumpAnimation();
    }

    private void PlayJumpSound()
    {
        // Implementation for playing a jump sound
    }

    private void TriggerJumpAnimation()
    {
        // Implementation for triggering a jump animation
    }
}