Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

import_namespace

Imports a namespace, returning a table of the types, functions, values, events and exports in it by name.

Bevy types with bindings live in a namespace per category (math, ecs, transform, ui, …), BMS’ own types and functions in bms, any other type in the namespace named after the crate defining it. Namespaces defined by scripts start with script..

local bms = import_namespace("bms")
local Vec3 = import_namespace("math").Vec3
bms.world.spawn()

Fails with a list of similar namespaces if the namespace does not exist.

Arguments

NameTypeDocumentation
arg1StringNo Documentation 🚧

Returns

NameTypeDocumentation
namespaceScriptValuea table of the contents of the namespace keyed by name.