With a normal script, the script is the same on the Prefab Parent and the Prefab Instance. You can override the parameters in an instance, but you cannot change the actual script.
You should follow the same rule with PlayMaker by treating the FSM as the "script" and exposed variables as parameters.
In other words, you should avoid making structural changes to the FSM in Instances, instead overriding exposed variables to tweak the behaviour of the instance.
The new Prefab UI now enforces these rules.
When you select a Prefab Instance you will see this header:
- Edit Prefab selects the FSM on the Prefab Parent. Changes propagate to all Instances.
- Edit Instance to unlock the instance for editing.
Certain edits will disconnect an Instance from its Prefab Parent:
- Adding or removing States, Actions, Events, or Variables
- Editing transitions between states
- Changing variable types
- Re-ordering actions
- Changing Templates
You will see a confirmation dialog when you make any of these edits.
If you confirm the edit, the Prefab Instance will be disconnected from the Prefab Parent:
- Apply applies all changes you made to the instance to the Prefab Parent.
- Revert discards all changes made to the instance and revert to the Prefab Parent.
This is useful if you drag a Prefab into a scene to edit it and then want to Apply the changes back to the Prefab.
NOTE: You cannot use Undo/Redo with Apply and Revert!
Scenes saved with older versions of PlayMaker may contain Prefab Instances that should be disconnected from their Prefab Parents.
When you load these scenes, PlayMaker will automatically update prefab instances as needed. You can find a list of FSMs that were updated in the Unity Console.
Hints and Tips
NEW 1.9.0+ collapse prefab info using the foldout button:
This is the recommended Prefab workflow, but if you need to, you can turn it off in Preferences > General : Prefabs.