sm.creation.importFromFile

Imports blueprint json file to world.

Kind: Function

Environments: Game

Game

sm.creation.importFromFile(
    world,
    pathString,
    worldPosition,
    worldRotation,
    importTransforms,
    indestructible
)

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.
pathString string The blueprint path.
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.)
indestructible (optional) boolean (DEPRECATED) Ignored, use setDestructable(false) on each body in creation. (Defaults to false)

Returns:

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