CharacterComp
Defined in: packages/threeplay/src/plugins/physics/types.ts:139
Fields added by character(): a kinematic character controller.
move() (from pos) slides along walls instead of passing through; only its
horizontal (x/z) part is used, vertical motion comes from gravity and jump().
Requires area(); do not combine with body().
Extends
Section titled “Extends”Methods
Section titled “Methods”add()?
Section titled “add()?”
optionaladd(this):void
Defined in: packages/threeplay/src/core/types.ts:63
Called when the object enters the scene (or when used on a live object).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”applyMove()
Section titled “applyMove()”applyMove(
delta,velocity):void
Defined in: packages/threeplay/src/plugins/transform/types.ts:36
delta is the displacement for this frame, velocity the requested units/s.
Parameters
Section titled “Parameters”Vector3
velocity
Section titled “velocity”Vector3
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”destroy()?
Section titled “destroy()?”
optionaldestroy(this):void
Defined in: packages/threeplay/src/core/types.ts:69
Called when the object is destroyed or the component removed.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”fixedUpdate()?
Section titled “fixedUpdate()?”
optionalfixedUpdate(this):void
Defined in: packages/threeplay/src/core/types.ts:67
Called at the fixed physics rate (50 Hz by default).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”inspect()?
Section titled “inspect()?”
optionalinspect(this):string|null|undefined
Defined in: packages/threeplay/src/core/types.ts:71
Short status line shown by the debug inspector.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”string | null | undefined
Inherited from
Section titled “Inherited from”isFalling()
Section titled “isFalling()”isFalling():
boolean
Defined in: packages/threeplay/src/plugins/physics/types.ts:149
Returns
Section titled “Returns”boolean
isGrounded()
Section titled “isGrounded()”isGrounded():
boolean
Defined in: packages/threeplay/src/plugins/physics/types.ts:148
Returns
Section titled “Returns”boolean
jump()
Section titled “jump()”jump(
force?):void
Defined in: packages/threeplay/src/plugins/physics/types.ts:147
Parameters
Section titled “Parameters”force?
Section titled “force?”number
Returns
Section titled “Returns”void
onGround()
Section titled “onGround()”onGround(
fn):EventController
Defined in: packages/threeplay/src/plugins/physics/types.ts:150
Parameters
Section titled “Parameters”() => void
Returns
Section titled “Returns”teleport()
Section titled “teleport()”teleport(
to):void
Defined in: packages/threeplay/src/plugins/physics/types.ts:151
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
update()?
Section titled “update()?”
optionalupdate(this):void
Defined in: packages/threeplay/src/core/types.ts:65
Called once per frame.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”conflicts?
Section titled “conflicts?”
optionalconflicts?:string[]
Defined in: packages/threeplay/src/core/types.ts:61
Ids of components that can’t be on the same object (checked both ways).
Inherited from
Section titled “Inherited from”id:
"character"
Defined in: packages/threeplay/src/plugins/physics/types.ts:140
Unique name. Two components with the same id replace each other.
Overrides
Section titled “Overrides”require?
Section titled “require?”
optionalrequire?:string[]
Defined in: packages/threeplay/src/core/types.ts:59
Ids of components that must be present on the object.
Inherited from
Section titled “Inherited from”vel:
Vector3
Defined in: packages/threeplay/src/plugins/physics/types.ts:146
Current velocity. Only vel.y is meaningful: it includes gravity and can be
assigned (vel.y = 5 launches the character). Horizontal movement comes only
from move()/moveTo(), so vel.x/vel.z are ignored when written.