sm.character

Associated object type: Character

A character is the physical body of a living entity in the world. Both players and units may control a character.

Functions:

  • createCharacter
  • preloadRenderables

  • sm.character.createCharacter(player, world, position, yaw?, pitch?, visible?)

    Server only

    Creates a new character in a world.

    Parameters:

    TypeNameDescription
    PlayerplayerThe player controlling the character.
    WorldworldThe world the character is created in.
    Vec3positionThe world position of the character.
    numberyaw?The initial yaw of the character (Optional).
    numberpitch?The initial pitch of the character (Optional).
    booleanvisible?Whether the character is visible on spawn. Defaults to true. (Optional)

    Returns:

    TypeDescription
    CharacterThe created character.

    sm.character.preloadRenderables(renderables)

    Client only

    Pre-loads renderable data to be used by the character. This eliminates excessive loading during run time.

    Parameters:

    TypeNameDescription
    tablerenderablesThe table of renderables { name = string, ... }.