Skip to content

Character

A Character is a type of Entity which provides additional features for a humanoid player controlled character model in the game. A Character can be controlled by a User. To get one from a User do user:GetPlayer(). Character derives from Entity and CharacterBase so if you have a Character you can do any of these functions as well as the functions in Entity or CharacterBase. You can do entity:IsA(Character) to see if a particular entity variable is a Character type entity.

Functions

Function Name Usage Description Notes
GetUser User character:GetUser() Get the User entity which controls this Character
GetLookAtPos Vector character:GetLookAtPos() Get the point the player is looking at, for an action camera this is the same as User:GetCameraLookAtPos but for orbit style cameras it will be in front of the player Server Only, Local Only
GetLookAt Vector,Vector character:GetLookAt() Return two values, the position of the player's virtual "eye" and the position the player is looking at. For an action camera this is the same as User:GetCameraLookAt but for an orbit style camera it will be the player's head position and what is in front of the player. Server Only, Local Only
SetInputLocked character:SetInputLocked(bool inputLocked) Lock player control Server Only, Local Only
GetInteraction Entity,HitResult character:GetInteraction() Get whichever Entity you would interact with if you pressed interact Server Only, Local Only
PlayVibrationEffect character:PlayVibrationEffect(VibrationEffectAsset vibrationEffect) Play a vibration effect on this Player, returning a Handle which can be used to stop the vibration effect. Server Only, Local Only
PlayManualVibration Handle character:PlayManualVibration(number intensity, number duration, bool affectSmallMotors, bool affectLargeMotors) Play a manual vibration effect on this Player, returning a Handle which can be used to stop the vibration effect. Manual vibrations can be updated on the fly using UpdateManualVibration Server Only, Local Only

Parameters

Parameter Name Usage Description Notes
canRoll bool canRoll Turn on or off ability to roll
canJump bool canJump Turn on or off ability to jump
canCrouch bool canCrouch Turn on or off ability to crouch or go prone
interactionRange number interactionRange Interaction range (from camera in cm)
displayDefaultNameTag bool displayDefaultNameTag Turn on or off the default name tag
displayDefaultQuickChat bool displayDefaultQuickChat Turn on or off the default overhead quick chat
cameraType number cameraType Set the character camera type. 1 = Action, 2 = Orbit
forcedCameraPerspective number forcedCameraPerspective Set restrictions on the action player camera perspective. 1 = No Restrictions, 2 = 1st Person Only, 3 = 3rd Person Only. (Default is 1)
canIronSight bool canIronSight Will the action camera iron-sight on secondary press
thirdPersonFOV number thirdPersonFOV FOV of the third person action camera
thirdPersonIronSightFOV number thirdPersonIronSightFOV FOV of the third person action camera in Iron Sight mode
firstPersonFOV number firstPersonFOV FOV of the third person action camera
firstPersonIronSightFOV number firstPersonIronSightFOV FOV of the third person action camera in Iron Sight mode
ironSightLookSpeedMultiplier number ironSightLookSpeedMultiplier Speed multiplier of the look controls in Iron Sight mode
cameraDistance number cameraDistance Set the orbit camera max distance from the character
cameraPitch number cameraPitch Set the orbit camera's pitch
cameraYaw number cameraYaw Set the orbit camera's yaw
cameraLock bool cameraLock Lock/Unlock the orbit camera
cameraSecondaryAction number cameraSecondaryAction Set what the secondary action does in the orbit camera
cameraCollisionEnabled bool cameraCollisionEnabled Enable/Disable the camera's collision

Overrides

Override Name Usage Description Notes
new_index character.var = object value