Author
Topic: Tips on Working with Prefabs? (Read 5167 times)

I've been trying to make a prototype for my next project with PlayMaker for the last few weeks. I've been able to pretty much create all the interactions I need for the prototype with it. Great tool!

I do however constantly run into problems with Prefabs with FSMs. I need a few objects to have the same behaviors but with different variables (strings, images...etc), so they are all connected to a prefab. I know whenever I want to make changes to the FSM, I need to do it on a prefab, but occasionally I would accidentally make changes on an object instead of the prefab itself, which usually results in a 30 minute frenzy of applying/reverting all the objects trying to fix this mistake.

When working with scripts, all behaviors on the objects can be changed when you make changes to the script. PlayerMaker works differently, and my struggle with Prefabs has been frustrating at times. Anyone has any tips on working with Prefabs with FSM?

I assume you're using the Apply and Revert buttons in the Inspector? What kind of changes do you make that a single Apply doesn't fix? Or do Apply/Revert not work as expected? Trying to understand how to improve the workflow...

I wonder if there's some visual indicator/warning that would help avoid the mistake. Or maybe a lock system - E.g., FSMs on prefab instances could be locked by default and you have to unlock them to edit them (could be a preference). Would something like that help?

The biggest problem when making changes on the Prefabs with FSM is that it resets all the variables in the objects to their default values - this is different from the default prefab behaviors with Unity. Oftentimes I just want to update the behavior of, say the iTween movement, but end up having to reset all the values again after the adjustment.

An option to always select the Prefab FSM would be good to avoid problems with Prefabs / variables, and also making the variables stay the same after updating the Prefabs would be great!