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 an instance of PlayerController
. This method is automatically invoked when a jump action is successfully executed, so you do not need to call it manually. You can override this method in a derived class to implement custom behavior that should occur when the player jumps.
Example
public class MyPlayerController : PlayerController
{
public override void OnJumped()
{
base.OnJumped();
// Custom behavior when the player jumps
// For example, play a jump sound or trigger an animation
}
}