Best Practice for Updating Behaviors on Prefabs and Dealing with View Only Mode

zodd

New member
Hello!

Awhile back I was trying to figure out why my behavior trees would go into view only mode and learned that this is a feature meant to protect from "data corruption" that can occur when Unity updates prefabs.

I am curious then, what is the best practice for updating a behavior tree related to a prefab? Is data corruption really that big of a risk or is it ok to update prefabs intentionally and then safety net is only to prevent excess/unnecessary updating?

Surely there's a better practice than unpacking the prefab, updating it in the scene, creating a new prefab from it and then updating all of the broken connections? XD

Thanks!
 
I recommend using JSON serialization for development as it allows better merging than binary serialization. When you are getting close to release you can switch to binary and take advantage of the speed boost. This then will reduce the risk of corruption on the behavior tree.

Beyond that using external behavior trees is a good solution as it will not be merged using Unity's prefab system.
 
Not only are External Behavior Trees the perfect solution, that is a wonderful feature I hadn't noticed yet! Thank you!
 
This is not obvious and needs to be addressed. It is incredibly annoying that this matter is not covered in the tutorials. This has put me off using Opsive products in future!
 
Top