We were getting the following error message that was causing a hard crash in Unity3D.
Prefab has multiple Transform components! Removing them automatically would not be safe.
UnityEditor.AssetDatabase:Refresh(ImportAssetOptions)
UnityEditor.AssetDatabase:Refresh()
Multiple Transforms? How?
Okay, so how is it possible for one of our prefabs to have multiple Transform components?
A little more investigation revealed that a developer’s use of Perforce merge changes (resolve conflicts) was actually the culprit. That is, when merging changes in the prefab (a text-based YAML file), the merge actually duplicated the transform instead of replacing the previous.

This is both totally understandable and surprising that it doesn’t happen more often. A nice reminder that merging prefabs can be dangerous (since Perforce merge-logic isn’t written for merging YAML.)
Here’s to hoping this helps anyone else encountering the same error.
For more topics on 2D graphics programming, be sure to check out my book, 2D Graphics Programming for Games available now both online and through your favorite independent bookseller.
2 comments on “Unity | Error – Prefab has multiple Transform components!”
Thanks, your post help me in hunt for this error.