Aego Русский

Prefab Instance

Links a node to the prefab it was created from.

component engine.PrefabInstance

Try it

Change one prefab instance

Both markers are linked to the same prefab; its Move Prefab script is initially disabled.

Enable the selected instance's Move Prefab script in the Inspector. This creates an instance override; after restart Ready checks the prefab link and moves only that copy. Reset removes the edit.

Starts the scene; open the example parameters to experiment.
Open in AegoDownload example project
Scene3 nodes
Node
d5600000000000000000000000000301
d5600000000000000000000000000301
d5600000000000000000000000000301
Node
d5600000000000000000000000000301
d5600000000000000000000000000301
d5600000000000000000000000000301
Camera
Transform
position[0, 0]rotation0scale[1, 1]
Camera 2D
zoomfloat40clearColorColor#111827ffscaleenumfitVirtualvirtualVec2[960, 540]activebooltrue
Scriptmain.aes
package demo

// Each copy gets its own attachment. Only a real prefab instance moves.
script MovePrefab {
    func Ready() {
        if node.IsPrefabInstance() {
            node.SetPosition(Vec2{-1, 0})
        }
    }
}