Home »Editing Basics»Working with Prefabs
Index

Working with Prefabs

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 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 changes to the FSM in Instances, only overriding exposed variables to tweak the behaviour of the instance.

Playmaker 1.8.6 (coming soon)

The prefab workflow has been clarified in 1.8.6+ to reduce the chance of errors.

When you select a Prefab Instance FSM you will see this header:

Choose Edit Prefab to select the FSM on the Prefab Parent. You can edit the Prefab and changes propagate to the Instances.

If you choose Edit Instance certain edits will disconnect the instance from the Prefab Parent:

  • Adding or removing States, Actions, Events, or Variables
  • Editing transitions between states
  • Changing variable types
  • Re-ordering actions

You will see a confirmation dialog when you make any of these edits.

If you confirm the edit, the Prefab Instance is 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.

NOTE: You cannot use Undo/Redo with these changes!

Updating Scenes

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 log of FSMs that were updated in the Playmaker Editor Log.

If for some reason you do not want to automatically update scenes, you can disable this behaviour in Preferences.