Open Asterune
CharacterController

CharacterController

Configures character movement, collision, input, and simulation.

Creatable
Instance.new("CharacterController")
Inherits
Instance
Replication
Standard

Behavior

CharacterController configures character movement, collision, input, and simulation.

Summary

Members47
Properties34
Methods11
Events2
  • Corrected: RBXScriptSignalparallel read

    Fires when the controller receives a movement correction.

  • StateChanged: RBXScriptSignalparallel read

    Fires when the character motion state changes.

Properties

Acceleration

CharacterController.Acceleration: number = 500

The acceleration applied to particles, in studs per second squared.

AirAcceleration

CharacterController.AirAcceleration: number = 143

The acceleration used while the character is airborne.

AirJumps

CharacterController.AirJumps: number = 0

The number of additional jumps permitted while airborne.

AutoJump

CharacterController.AutoJump: boolean = true

Whether the controller automatically requests jumps when appropriate.

AutoRotate

CharacterController.AutoRotate: boolean = true

Whether the controller turns the character toward its movement direction.

ClimbReach

CharacterController.ClimbReach: number = 0.75

The distance used to detect climbable geometry.

ClimbSpeed

CharacterController.ClimbSpeed: number = 0.7

The character's climbing speed, in studs per second.

CollisionType

The collision-box configuration used by the character.

CoyoteTime

CharacterController.CoyoteTime: number = 0.125

The interval after leaving the ground during which a jump remains permitted, in seconds.

Deceleration

CharacterController.Deceleration: number = 500

The rate at which the controller reduces movement speed without directional input.

Enabled

CharacterController.Enabled: boolean = true

Whether this character controller is enabled.

FloorSnapDistance

CharacterController.FloorSnapDistance: number = 1.5

The maximum distance over which the controller snaps to supporting ground, in studs.

GravityScale

CharacterController.GravityScale: number = 1

Multiplier applied to the gravity acceleration affecting this body.

Grounded

CharacterController.Grounded: boolean = false

Whether the controller currently detects supporting ground.

HipHeight

CharacterController.HipHeight: number = 0

The vertical offset used to position the character above its supporting surface, in studs.

HitboxSize

CharacterController.HitboxSize: Vector3 = Vector3.new(2, 5, 1)

The dimensions of the character's collision body, in studs.

Jump

CharacterController.Jump: boolean = false

Whether the controller has a pending jump request.

JumpBufferTime

CharacterController.JumpBufferTime: number = 0

How long an early jump request remains valid, in seconds.

JumpHeight

CharacterController.JumpHeight: number = 7.2

The requested jump height, in studs.

MaxSlopeAngle

CharacterController.MaxSlopeAngle: number = 89

The steepest ground angle treated as walkable, in degrees.

MoveDirection

CharacterController.MoveDirection: Vector3 = Vector3.new(0, 0, 0)

The controller's requested movement direction.

MovementMode

CharacterController.MovementMode: Enum.MovementMode = Enum.MovementMode.Walking

The active movement simulation mode.

Responsiveness

CharacterController.Responsiveness: number = 150

The response strength used to approach the actuator's target.

RootPart

CharacterController.RootPart: BasePart? = nil

The BasePart used as the character's movement root, or nil when unavailable.

SimulationModule

CharacterController.SimulationModule: ModuleScript? = nil

A ModuleScript returning Step(state, input, dt) or a function with that signature. The engine runs it after the movement motor on the owner, during prediction replay, and on the server. State includes Position, Velocity, Yaw, Up, Grounded, State, Replaying, and Custom. Input includes Direction, CameraRelative, CameraYaw, Jump, AutoJump, and Custom. dt is in seconds. Avoid unrelated side effects because replay can evaluate the same input again.

State

The current character motion state.

StepHeight

CharacterController.StepHeight: number = 2.45

The maximum ground step the controller can traverse, in studs.

SwimAcceleration

CharacterController.SwimAcceleration: number = 100

The acceleration used while swimming.

SwimDepth

CharacterController.SwimDepth: number = 1

The immersion depth used for swimming behavior.

SwimSpeed

CharacterController.SwimSpeed: number = 1

The character's swimming speed, in studs per second.

TurnSpeed

CharacterController.TurnSpeed: number = 8

The speed at which the controller changes facing direction.

UpDirection

CharacterController.UpDirection: Vector3 = Vector3.new(0, 0, 0)

The world-space up direction used by the controller.

Velocity

CharacterController.Velocity: Vector3 = Vector3.new(0, 0, 0)

The current character velocity, in studs per second.

WalkSpeed

CharacterController.WalkSpeed: number = 16

The character's walking speed, in studs per second.

Methods

AddImpulse

CharacterController:AddImpulse(velocity: Vector3): ()

Adds an instantaneous velocity change to the character controller.

ApplyPreset

CharacterController:ApplyPreset(name: string): ()

Applies a named set of movement-controller settings.

AuthorizeMovement

CharacterController:AuthorizeMovement(options: MovementGrantOptions): boolean

Authorizes a server-controlled movement change. Options are Duration in seconds, optional MaxSpeed defaulting to walk speed, and Flight defaulting to false. Unknown options cause an error. Returns false when no associated character player exists. See MovementGrantOptions.

GetExecutionGroup

CharacterController:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

GetInput

CharacterController:GetInput(name: string): ControllerValue?

Returns the named controller input value, or nil when unset.

GetPresets

CharacterController:GetPresets(): { string }

Returns the names of the available controller presets.

GetState

CharacterController:GetState(name: string): ControllerValue?

Returns the named custom simulation-state value, or nil when unset.

Move

CharacterController:Move(direction: Vector3, relativeToCamera: boolean?): ()

Sets the requested movement direction. Set relativeToCamera to interpret the direction relative to the camera.

SetInput

CharacterController:SetInput(name: string, value: ControllerValue?): ()

Sets the named controller input value. Passing nil removes it.

SetState

CharacterController:SetState(name: string, value: ControllerValue?): ()

Sets a named custom simulation-state value. Pass nil to remove it.

Teleport

CharacterController:Teleport(cframe: CFrame): ()

Moves the controller to the supplied world-space CFrame.

Events

Corrected

CharacterController.Corrected: RBXScriptSignal

Fires when the controller receives a movement correction.

StateChanged

CharacterController.StateChanged: RBXScriptSignal

Fires when the character motion state changes.

Inherited members

Inherited47

Instance