CharacterController2DData
此内容尚不支持你的语言。
Defined in: physics/CharacterController2D.ts:46
The fields of the CharacterController2D component, whose tier this shape carries.
Properties
Section titled “Properties”floorMaxAngle
Section titled “floorMaxAngle”floorMaxAngle:
number
Defined in: physics/CharacterController2D.ts:52
Max walkable slope, measured from up (radians). Steeper = wall.
floorNormal
Section titled “floorNormal”floorNormal:
Vec2
Defined in: physics/CharacterController2D.ts:71
Output: normal of the last floor touched (zero when airborne).
isOnCeiling
Section titled “isOnCeiling”isOnCeiling:
boolean
Defined in: physics/CharacterController2D.ts:69
Output: touched a surface classified as ceiling this move.
isOnFloor
Section titled “isOnFloor”isOnFloor:
boolean
Defined in: physics/CharacterController2D.ts:65
Output: touched a surface classified as floor this move.
isOnWall
Section titled “isOnWall”isOnWall:
boolean
Defined in: physics/CharacterController2D.ts:67
Output: touched a surface classified as wall this move.
maskBits
Section titled “maskBits”maskBits:
number
Defined in: physics/CharacterController2D.ts:62
Collision layers that block the character.
maxSlides
Section titled “maxSlides”maxSlides:
number
Defined in: physics/CharacterController2D.ts:54
Slide iterations per move (corners need more than one).
realVelocity
Section titled “realVelocity”realVelocity:
Vec2
Defined in: physics/CharacterController2D.ts:73
Output: actual displacement / dt after collisions (pixels/second).
skinWidth
Section titled “skinWidth”skinWidth:
number
Defined in: physics/CharacterController2D.ts:56
Gap kept from surfaces (pixels) so the body doesn’t stick/jitter.
slideOnCeiling
Section titled “slideOnCeiling”slideOnCeiling:
boolean
Defined in: physics/CharacterController2D.ts:60
When false, a ceiling hit stops the remaining move instead of sliding along it.
snapLength
Section titled “snapLength”snapLength:
number
Defined in: physics/CharacterController2D.ts:58
Down-probe length (pixels) to stay glued to floors on slopes/stairs; 0 = off.
up:
Vec2
Defined in: physics/CharacterController2D.ts:50
Up direction for floor/ceiling classification (opposes gravity).
velocity
Section titled “velocity”velocity:
Vec2
Defined in: physics/CharacterController2D.ts:48
Desired velocity in world pixels/second; set it from gameplay each step.