Prefab
Client only. One of the game's own prefabs (a house with its doors, a wall, a well) built in this game only, as an editor places them while its author works. It stands as the game lays it out in its villages, solid. The server does not know about it, and no other player sees it. A game holds up to 2048, and they end when their resource stops or the world goes. To build one for every player, use Prop.spawn('prefab:<name>') on the server.
prefab.place()
Prefab.place(name, position, orientation)Builds a prefab in this game, its nested prefabs (doors, sheds) each on their own; the stains a building's walls carry in the game's levels (moss, leaks: its decals) are left out. Throws a RangeError for a name the catalogue does not carry, for one the game cannot build and for a place outside the world, a TypeError for a missing name or position.
prefab.find()
Prefab.find(text, max = FIND_MAX)The paths of the prefabs the game can build that contain the text, in any case, in catalogue order.
prefab.all()
Prefab.all()The prefabs your resource placed that still stand.
prefab.valid
validFalse once it was destroyed or its resource stopped.
prefab.name
nameIts path under the game's Prefabs/ folder.
prefab.position
positionIts location. Setting it builds the prefab again there.
prefab.rotation
rotationThe way it faces. Setting it builds the prefab again turned.
prefab.setPose()
setPose(position, orientation)Moves it in one go, and turns it when a rotation is given.
prefab.destroy()
destroy()Takes it away. Safe to repeat.
prefab.id
id: numberIts id on this machine.