sm.creation.importFromString

Imports blueprint json string to world.

Kind: Function

Environments: Game

Game

sm.creation.importFromString(
    world,
    jsonString,
    worldPosition,
    worldRotation,
    importTransforms,
    forceInactive
)

Open the full Game reference

Availability: Server only

Warning: If the blueprint was not exported with transforms the importer will treat it as if importTransforms was disabled.

Parameters:

Name Type Description
world World The world to import to.
jsonString string The blueprint json string.
worldPosition (optional) Vec3 World position of import. If importTransforms is enabled position is applied to the imported transform. (Defaults to vec3.zero().)
worldRotation (optional) Quat World rotation of import. If importTransforms is enabled rotation is applied to the imported transform. (Defaults to quat.identity().)
importTransforms (optional) boolean Import world transforms from bodies. (Defaults to false.)
forceInactive (optional) boolean Import interactables in an inactive state. (Defaults to false.)

Returns:

Type Description
table The table {Body, ...} of bodies created from the blueprint.