Some weird bug with Source Image [SOLVED]

Hello!
I am making my very first game in Unity, and everything is going pretty well.

I’m making a tutorial window. I have a seperate tutorial canvas, with an Image childed to it.
I’m trying to select a specific sprite as the source image, but it just won’t show up. with some assets it works, with others it just doesn’t.

I’m sorry it’s a link, for some reason I just can’t insert images.

As you can see, in the inspector I chose the Triangle as Source Image, and in the scene view the image is just a weird rectangle. Other sprites like the info symbol work just fine, this one just won’t.
The Triangle’s Texture Type is Sprite (2D and UI).

I would greatly appreciate any help, thank you :slight_smile:

Check your image import settings.

Make sure you see checkerboard pattern behind your opaque shape in your image preview. Now it seems like your preview too shows white square, not a triangle on transparent background.

So if you don’t see transparency;
Check image “Alpha Source”. It should most likely be set to “Input Texture Alpha”.
Also, “Alpha is Transparency” should be checked.

Other than that, it is bit hard to say what else could be going on…

Hey eses thanks for replying. So, Alpha Source is set to Input Texture Alpha and I activated Alpha is Transparency.

Still no checkerboard pattern and the triangle in both the preview and scene view is just a white square, like you said.

That triangle is a just unity placeholder shape, and it works when I apply it on a game object with Sprite Renderer.
So I’m not sure what to do… thank you for replying though :slight_smile:

“That triangle is a just unity placeholder shape”

You mean you are using mesh sprite which you create from Create/Sprites/?

Well if you had mentioned this…

It won’t work.

You’ll have to use a proper bitmap with alpha channel.

I’m sorry I’m pretty new to this. What exactly is a proper bitmap?
Anyway I went ahead and just created a simple triangle in GIMP and exported to Unity, so I guess problem pretty much solved.

“I’m sorry I’m pretty new to this. What exactly is a proper bitmap?”

= a bitmap texture/image file with transparency or alpha channel.

Those polygonal shapes are not textures AFAIK. Those ones look like your imported textures, but are exactly not equal in features I guess…

I see. Alright, thank you very much for your help friend, appreciate it.

Note:
You can actually make those shapes work like they had alpha channel, even if they don’t have alpha channel. Those shapes are created using custom shape feature in sprite editor.

Steps:
In your Image component:
Select Source Image - your sprite shape like triangle.
Set Image Type to “Simple”.
Check “Use Sprite Mesh”.

This way Image component will use shape information from sprite.

1 Like

Well, thanks again. I’ll be sure to check that out although I already recreated the shapes with an alpha channel.

EDIT: yep, that works fine. Thanks :slight_smile:

1 Like