Skip to main content

sm.character

Associated object type: Character

A Character is the physical body of a living entity in the world.
Both Players and AI Units may control a character.

Functions

createCharacter

local character = sm.character.createCharacter(player, world, position, yaw, pitch)

Server-Only

Creates a new character in a world.

Parameters:

  • player (Player): The player controlling the character.
  • world (World): The world the character is created in.
  • position (Vec3): The world position of the character.
  • yaw (number): The initial yaw of the character (Optional).
  • pitch (number): The initial pitch of the character (Optional).

Returns:

  • character (Character): The created character.

preloadRenderables

sm.character.preloadRenderables(renderables)

Client-Only

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

Parameters:

  • renderables (table): The array of renderable file paths.