KX_CharacterWrapper(PyObjectPlus)

base class — PyObjectPlus

class bge.types.KX_CharacterWrapper(PyObjectPlus)

A wrapper to expose character physics options.

onGround

Whether or not the character is on the ground. (read-only)

Type :boolean
gravity

The gravity value used for the character.

Type :float
maxJumps

The maximum number of jumps a character can perform before having to touch the ground. By default this is set to 1. 2 allows for a double jump, etc.

Type :int
jumpCount

The current jump count. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump.

Type :int
walkDirection

The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.

Type :list [x, y, z]
jump()

The character jumps based on it’s jump speed.

Previous topic

KX_CameraActuator(SCA_IActuator)

Next topic

KX_ConstraintActuator(SCA_IActuator)