[Bug] The same field name is serialized multiple times in the class or its parent class. This is not supported

Paramedic

Member
In my main project I started to have weird error displayed, no during gameplay, but after save of any script:
The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(StandardUISubtitlePanel) m_animator
I could not figure it out where the problem is, but actually it was not making any gameplay errors so I ignored it. After some time I discovered, that when I enter debug mode in Inspector when game is running, and I focus Player gameObject, then I got an error and game stops:
The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) m_GameObject
UnityEditor.InspectorWindow:RedrawFromNative ()
When I started game but with Player prefab opened I got an error:
The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) m_GameObject
UnityEditor.GenericMenu:CatchMenu (object,string[],int)
So I was deleting components and I discovered that UnityInputSystem Component is the reason. So I created reproduction project, you start on empty scene, just with GameObject with UnityInputSystem Component. Try to run game, enter debug mode in inspector and focus GameObject, you will get an error:
Edit: URL removed. Anybody can read this forum s please do not post links to complete projects.
 
Last edited by a moderator:
This is a bug in Unity. m_GameObject isn't actually serialized since it's a private object. With that said, if you add the [System.NonSerialized] attribute to the field (in this case in PlayerInput) then it'll prevent that error from happening.
 
Top