- Home /
Cant change color of an image with custom sprite
I tried to make custom cross-hair but when i set texture type as 2D and UI and then put the sprite of the cross-hair in UI image I couldn't change the color of it even in inspector. I cant even change the color as sprite. Its png file...
Thank you for answer.
can you share screenshots? its hard to imagiune whats happening, t¡you cant tint the image with the color property? just in case, you know that the texture doest change just the image component gets tint
hey, I made a clock in photoshop and then imported it as png file, then I set it to sprite and now I can't change the color of it in any way. I wonder how to do it?
For changing the color of the Sprite you need to change It using Photoshop. Un Unity you can use the Color property of each SpriteRenderer component that Will tint the speciric object but not change the texture
which version of unity do u use? are you making game 2d or 3d? that is a UI object or gameobject
Answer by xxv1rexx · Jul 28, 2019 at 12:03 PM
It's working now. I just needed to make the image white. Now I can change the color of it in unity... Thank you all for your help :)
from black crosshair to white crosshair in photoshop
Super awesome thanks! I had a black icon and wondered for so long why it didn't work! Rewarded! ;)
Answer by SirPaddow · Jul 27, 2019 at 10:24 PM
You should share code or screenshots, but I'll try to guess the problem:
If you're changing the sprite through script, you should use overrideSprite rather than sprite
// buggy
image.sprite = mySprite;
// should work
image.overrideSprite = mySprite;
No, it's just that when I made an image in photoshop and then set it to sprite I couldn't edit the color of it in unity.
Your answer
Follow this Question
Related Questions
Changing a UI image sprite in scripts results in a black texture 0 Answers
How can I put the single pieces of a sliced Sprite into an array? 0 Answers
Sprite Becoming Blurry 2 Answers
Unable to drag image from Assets folder to Sprite: None under Sprite Renderer. 0 Answers
How do I change the import settings when using sprite.create with a WWW.texture from a png image. 1 Answer