Skip to main content

Characterbody

Complete API reference for Characterbody, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Physics

Component: no


public class Characterbody extends PhysicsComponent

Constructors

SignatureDescription
Characterbody(Characterbody)Executes Characterbody and returns after the underlying engine call finishes.
Characterbody()Executes Characterbody and returns after the underlying engine call finishes.

Attributes

NameTypeDescription
componentCharacterbodyRepresents the component value stored on this instance. Read or assign to update the property.

Virtual Attributes

NameTypeAccessDescription
forwardSpeedfloatget/setReturns the forward movement speed.
globalDirectionsbooleanget/setReturns whether the movement direction is global.
gravityEnabledbooleanget/setReturns whether the character's gravity is enabled.
gravityMultiplierVector3get/setReturns the gravity multiplier of the character.
heightfloatget/setReturns the character's height.
horizontalPhysicsVelocityVector2getReturns the character's horizontal velocity.
jumpSpeedfloatget/setReturns the jump speed of the character.
physicsLayerPhysicsLayerget/setReturns the PhysicsLayer of the Characterbody.
physicsVelocityVector3getReturns the character's velocity.
sideSpeedfloatget/setReturns the lateral movement speed.
stepHeightfloatget/setReturns the maximum step height the character can climb.
widthfloatget/setReturns the character's width.

Methods

SignatureReturnsDescription
isGrounded()booleanReturns whether the character is grounded.
onGround()booleanReturns whether the character is on the ground.
canJump()booleanReturns whether the character is on the ground.
jump()voidMakes the character jump.
setSpeed(float, float)voidSets the lateral (X) and forward (Z) movement speed.
zeroSpeed()voidResets lateral and forward speed to zero.