Builtin Library
README.md
sc.replaceWithAsset (deprecated)
Deprecated — superseded by the
entityOps/scene/appearancetoolboxes. Add or swap aModelcomponent on the target entity via the entity API (entity(id).component.add("Model", { model = "<mesh>" })).
Swaps an already-spawned placeholder entity for a real asset, in place. You block a scene out with rough stand-ins, lay them where they belong, then replace each one with the finished asset — a generated bundle, a library model — without re-positioning anything. The replacement inherits the placeholder's parent, name, and local transform (position, rotation, scale), and the placeholder together with its whole subtree is removed. By default it keeps the placeholder's scale; it can instead adopt the asset's own scale, and physics and other spawn settings pass through to the new entity. It returns the new entity id, and keeps the placeholder's name by default so references by name keep working. A locked placeholder, such as the player, is refused until unlocked.