Prefab's icon

Prefab 1.0.1a Scripts 4.0 Community

Submitted by user KoBeWi; MIT; 2022-09-11

Simple wrapper for PackedScene that allows you to quickly pack part of a scene, so you can have e.g. "internal scenes" that you don't need to save to separate file. Usage:

var prefab = Prefab.create($AnyNode)

$AnyNode will be freed (or queue_freed if you pass true as second argument) and you can then instance the prefab to make copies of that node. Prefab automatically sets the owner of the children, so they are packed too.

You can also save the prefab to a file, but it's not the intended usage. See repo README for more info.

View files Download Submit an issue Recent Edits