Hello everyone,
My code is simple. I have a script that references an image component and it assigns a sprite to it.
I’m assigning the image component manually in the editor as you can see in the screenshot here:
For some reason, every time I check for image component. The code tells me it’s null. I added an if(ImageComponent == null) condition to check and it always returns true.
Also, because I assigned this in the editor. I can clearly see if it was accidentally removed for some reason during runtime. But that never happened, I can still see the image component assigned correctly in the editor at all times.
Is that a known bug in Unity 2019.3?
Update: It’s also worth noting that I previously used a sprite renderer component instead of Image component and that worked no problem. But right now I want to use image component since I want to utilize the canvas scaling and anchoring system that Image component uses. I’m starting to think this is an issue with image component specifically.