• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • Globals

    Character

    Inherits from:

    Represents an in-game character, providing properties and methods to control its movement, appearance, and interaction within the game environment.

    Properties

    AnchorChanged

    ClientAndServer
    ReadOnly

    Event that fires when the characters anchor changes

    AnimationEvent

    ClientOnly
    ReadOnly

    Event fired when an animation event occurs

    local player = client.localPlayer
    player.character.AnimationEvent:Connect(function(event)
      print("Animation event: " .. event)
    end)
    

    EmotePlayed

    ClientOnly
    ReadOnly

    Event that fires when the character plays an emote

    EmoteStopped

    ClientOnly
    ReadOnly

    Event that fires when the character stops an emote in progress or a looping emote

    MoveFinished

    ClientOnly
    ReadOnly

    Event fired when the character has finished moving

    local player = client.localPlayer
    player.character.MoveFinished:Connect(function()
      print("Character has finished moving.")
    end)
    

    MoveStarted

    ClientOnly
    ReadOnly

    Event fired when the character has started moving

    OutfitChanged

    ClientOnly
    ReadOnly

    Event that fires when the outfit of a character changes

    StateChanged

    ClientOnly
    ReadOnly

    Event fired when the characters state changes

    local player = client.localPlayer
    player.character.StateChanged:Connect(function(state)
      print("Character state changed to " .. state)
    end)
    

    anchor

    ClientAndServer

    Return the character's current anchor

    Returns the transform for chat bubbles.

    Returns the collection of default outfits for the character

    destination

    ClientOnly
    ReadOnly

    Return the destination point of the current move

    local player = client.localPlayer
    print(tostring(player.character.destination))
    

    distanceToDestination

    number
    ClientOnly
    ReadOnly

    Return the distance to the destination if character is moving or 0

    local player = client.localPlayer
    print(tostring(player.character.distanceToDestination))
    

    hasOutfit

    boolean
    ClientOnly
    ReadOnly

    Returns true if the character has one or more outfits

    isAnchored

    boolean
    ClientOnly
    ReadOnly

    Returns true if the character is currently anchored

    isIdle

    boolean
    ClientOnly
    ReadOnly

    isMoving

    boolean
    ClientOnly
    ReadOnly

    Returns true if the character is in a moving state (Walking, Running, or Jumping). A character attached to an anchor is considered to be in an idle state, even if the anchor is set to play a walk or run animation.

    local player = client.localPlayer
    print(tostring(player.character.isMoving))
    

    jogDistance

    number
    ClientOnly

    Get/Set the distance at which the character will choose to jog instead of walk

    jogSpeed

    number
    ClientOnly

    Get/Set the characters jog speed

    jumpSpeed

    number
    ClientOnly

    Get/Set the characters run speed

    outfits

    ClientOnly
    ReadOnly

    Return the outfits assigned to this character

    pet

    ClientOnly

    player

    ClientAndServer

    Returns the player that is controlling this character if the character is the player character, otherwise null

    renderLayer

    number
    ClientOnly

    The rendering layer of the character for drawing order.

    The position of the character in the game world for rendering purposes.

    local player = client.localPlayer
    player.character.renderPosition = Vector3.New(0, 0, 0)
    

    The rotation of the character in the game world for rendering purposes.

    local player = client.localPlayer
    player.character.renderRotation = Quaternion.New(0, 0, 0, 1)
    

    The scale of the character in the game world for rendering purposes.

    local player = client.localPlayer
    player.character.renderScale = Vector3.New(1, 1, 1)
    

    renderShadow

    boolean
    ClientOnly

    runDistance

    number
    ClientOnly

    Get/Set the distance at which the character will choose to run instead of walk

    runSpeed

    number
    ClientOnly

    Get/Set the characters run speed

    speed

    number
    ClientOnly

    The movement speed of the character. You must wait for the player to connect before setting this property.

    local player = client.localPlayer
    player.character.speed = 10
    

    The current state of the character.

    usePathfinding

    boolean
    ClientOnly

    When set to true, the character uses pathfinding to navigate to its destination.

    local player = client.localPlayer
    player.character.usePathfinding = true
    

    walkSpeed

    number
    ClientOnly

    Get/Set the characters walk speed

    Methods

    AddOutfit

    ClientOnly

    Adds an outfit to the character's current appearance.

    Parameters

    The outfit asset to add to the character.

    Returns

    void

    AttachToBone

    ClientOnly

    Attaches an object to a Character's bone. You can use the Bones class to get a list of available bones.

    Parameters

    attachment

    Transform that you want to attach to the character.

    boneName
    string

    Name of the bone to attach the object to.

    offsetPosition

    After being attached, the object's localPosition will be set to this value.

    offsetRotation

    After being attached, the object's localRotation will be set to this value.

    Returns

    void

    AttachToBone

    ClientOnly

    Attaches an object to a Character's bone. You can use the Bones class to get a list of available bones.

    Parameters

    attachment

    Transform that you want to attach to the character.

    boneName
    string

    Name of the bone to attach the object to.

    keepCurrentPosition
    boolean
    optional

    If true, the attachment will keep its current world position after being attached.

    keepCurrentRotation
    boolean
    optional

    If true, the attachment will keep its current world rotation after being attached.

    Returns

    void

    CopyOutfit

    ClientOnly

    Copy the outfit from the given character replacing the default outfit and any additional outfits

    Parameters

    character

    Returns

    void

    DetachFromBone

    ClientOnly

    Detaches an object that has been attached to this character.

    Parameters

    attachment

    Transform that you want to detach.

    Returns

    void

    GetPathTo

    ClientOnly

    Parameters

    position
    areaMask
    number
    optional
    targetSearchDistance
    number
    optional

    Parameters

    destination
    stopDistance
    number
    areaMask
    number
    optional
    targetSearchDistance
    number
    optional

    HasAnimation

    ClientOnly

    Play a single character animation using a character animation asset

    Parameters

    anim
    string

    Returns

    boolean

    JumpTo

    ClientOnly

    Jump from the current position to the given position

    Parameters

    position
    taskCompleteCallback
    optional

    Returns

    boolean

    JumpTo

    ClientOnly

    Jump from the current position to the given position

    Parameters

    position
    jumpSpeedMultiplier
    number
    jumpHeightMultiplier
    number
    taskCompleteCallback
    optional

    Returns

    boolean

    MoveAlongPath

    ClientOnly

    Parameters

    callback
    optional

    Returns

    void

    MoveTo

    ClientOnly

    Move the avatar to a position

    local player = client.localPlayer
    player.character:MoveTo(Vector3.New(0, 0, 0))
    

    Parameters

    position

    The target position for the character to move to.

    areaMask
    number
    optional

    An optional mask to specify allowed movement areas.

    callback
    optional

    A callback function to execute when movement is complete.

    targetSearchDistance
    number
    optional

    The target search distance for the character to move to.

    Returns

    boolean

    True if movement is successfully initiated.

    MoveToAnchor

    ClientOnly

    Parameters

    anchor
    areaMask
    number
    optional
    callback
    optional

    Returns

    boolean

    Move the character within a certain distance of a position

    local player = client.localPlayer
    player.character:MoveWithinRangeOf(Vector3.New(0, 0, 0), 5)
    

    Parameters

    destination

    The target position for the character to move to.

    stopDistance
    number

    The distance to stop at.

    areaMask
    number
    optional

    An optional mask to specify allowed movement areas.

    callback
    optional

    A callback function to execute when movement is complete.

    targetSearchDistance
    number
    optional

    The target search distance for the character to move to.

    Returns

    boolean

    True if movement is successfully initiated.

    PlayAnimation

    ClientOnly

    Play a single character animation using a character animation asset

    Parameters

    speed
    number
    optional
    loop
    boolean
    optional
    callback
    optional

    Returns

    boolean

    PlayAnimation

    ClientOnly

    Play a single character animation using a character animation asset

    Parameters

    anim
    string
    speed
    number
    optional
    loop
    boolean
    optional
    callback
    optional

    Returns

    boolean

    PlayEmote

    ClientOnly

    Plays a specified emote animation on the character.

    local player = client.localPlayer
    player.character:PlayEmote("idle-dance-casual", 1.0, false, function()
    print("Emote playback complete.")
    end)
    

    Parameters

    emoteName
    string

    The name of the emote to play.

    loop
    boolean
    optional

    Whether the emote should loop.

    callback
    optional

    A callback function to execute when the emote playback is complete.

    Returns

    boolean

    PlayEmote

    ClientOnly

    Plays a specified emote animation on the character.

    local player = client.localPlayer
    player.character:PlayEmote("idle-dance-casual", 1.0, false, function()
    print("Emote playback complete.")
    end)
    

    Parameters

    emoteName
    string

    The name of the emote to play.

    speed
    number

    The speed of the emote.

    loop
    boolean
    optional

    Whether the emote should loop.

    callback
    optional

    A callback function to execute when the emote playback is complete.

    Returns

    boolean

    Returns

    void

    RemoveOutfit

    ClientOnly

    Remove an outfit from the character

    Parameters

    The outfit asset to remove from the character.

    Returns

    void

    ResetOutfit

    ClientOnly

    Reset the outfit back to the default state, for player characters this means their chosen outfit and for npcs this means the outfit they were created with.

    Returns

    void

    SetIdle

    ClientOnly

    Set the character into an idle state.

    local player = client.localPlayer
    player.character:SetIdle()
    

    Returns

    void

    SetOutfit

    ClientOnly

    Set the outfit for the character by removing all existing outfits and replacing with the new outfit

    Parameters

    The outfit asset to apply to the character.

    Returns

    void

    StopEmote

    ClientOnly

    Stop a looping emote that is playing

    Returns

    void

    Teleport

    ClientOnly

    Teleport the character to the given position

    local player = client.localPlayer
    player.character:Teleport(Vector3.New(0, 0, 0))
    

    Parameters

    position

    The target position for the character to teleport to.

    taskCompleteCallback
    optional

    A callback function to execute when the teleport is complete.

    Returns

    boolean

    True if teleport is successfully initiated.

    Teleport the character to an anchor from wherever they are

    Parameters

    anchor

    Returns

    boolean

    Smoothly transitions the character's render position from one point to another.

    local player = client.localPlayer
    player.character:TweenRenderPosition(Vector3.New(0, 0, 0), Vector3.New(10, 0, 0))
    

    Parameters

    The starting position for the tween.

    The ending position for the tween.

    Returns

    A Tween object representing the transition.

    Initiates a smooth transition for the character's render position to a specified destination.

    local player = client.localPlayer
    player.character:TweenRenderPositionTo(Vector3.New(10, 0, 0))
    

    Parameters

    The target position for the character's render position.

    Returns

    A Tween object representing the transition.

    Updated 12 days ago

    PocketWorlds Icon

    © 2025 Pocket Worlds. All rights reserved.