Hi! I’ve been working on Cocos Creator for a few months now and this was the first time I happened to encountered this problem. There were times I can’t drag my node to my cc.Label at custom component because it is said to be null.
I also got an error message where the string from getComponent(cc.Label) was unidentified.
(This is a button node with cc.Label component)
“Uncaught TypeError: Cannot set property ‘string’ of null”
Additional:
I also got a warning from the Cocos Creator console… ‘Can not instantiate CCClass ‘undefined’ with argument’
…which is probably meant for cc.Label.
Thank you for the reply. Yes, all of the properties were in type cc.Label.
Actually this was working before until all of the cc.Label properties in all of my scripts became undefined. I instantiate all my labels to onLoad method.
My guess was that cc class doesn’t recognized the cc.Label and becomes undefined.