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=nil, pitch=nil)

    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=nilThe initial yaw of the character (Optional).
    numberpitch=nilThe initial pitch of the character (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, ... }.