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.
Scene3 nodes
Node
d5600000000000000000000000000301
d5600000000000000000000000000301
d5600000000000000000000000000301
Node
d5600000000000000000000000000301
d5600000000000000000000000000301
d5600000000000000000000000000301
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})
}
}
}