Player input controller for Character movement. More...
| Import Statement: | import Clayground.Character3D |
CharacterController translates input axis values into character movement and rotation. Bind axisX and axisY to a GameController or other input source to control a character.
The controller automatically sets the character's activity state based on movement (Idle, Walking, Running).
Example usage:
import Clayground.Character3D
import Clayground.GameController
Character {
id: hero
}
GameController {
id: gamepad
}
CharacterController {
character: hero
axisX: gamepad.axisLeftX
axisY: gamepad.axisLeftY
sprinting: gamepad.buttonL1
}
See also Character and PatrolController.
axisX : real |
Horizontal input axis for turning (-1 to 1, required).
axisY : real |
Vertical input axis for forward/backward (-1 to 1, required).
character : QtObject |
The character to control (required).
enabled : bool |
Whether the controller is active.
inputDeadzone : real |
Axis values below this threshold are treated as zero.
isMoving : bool |
True when forward/backward input is active.
isTurning : bool |
True when turn input is active.
processedAxisX : real |
Horizontal axis value after deadzone is applied.
processedAxisY : real |
Vertical axis value after deadzone is applied.
sprinting : bool |
When true, character runs instead of walks.
turnSpeed : real |
Turn speed in degrees per frame per unit axis input.
updateInterval : int |
Update frequency in milliseconds.
moved(real deltaX, real deltaZ) |
Emitted when the character moves.
Note: The corresponding handler is onMoved.
turned(real deltaYaw) |
Emitted when the character turns.
Note: The corresponding handler is onTurned.