So I was playing around with attatching the Button Script to 3D Objects and use them as buttons with Transition mode Animation. I didn’t generate the Animation so I manually added the Animator component which ended up over the Button script in the Inspector.
And here comes the strange warning 5 times on pressing play and 5 times on stopping:
Animator has not been initialized.
UnityEngine.UI.Selectable:OnDisable()
I wondered why this was happening and looked at my other buttons. The only difference is that the Animator in those comes after the Button script. And that’s actually the cause. When I move the Animator down, the warnings stops.
So my question is: Is this a bug? Should I report this? Did I miss some kind of documentation on this?
TL;DR
When using Button script or any other UI.Selectable derived script the Animator has to be below the Button script or you’ll get warning spammed.