- Home /
Sprite not showing in spriteRenderer
I have a player object that i want to animate. I put the starting sprite in the spriterenderer but it doesn't show up in the scene. I tried an image component with the sprite but it doesn't animate with an image component. Is there something I am missing? I am using Unity Editor 2020.3.26f1
Hi @bookwormbeekeeper, if you still not solve this issue... just replace SpriteRender Component with Image Component and end.... succes! Hope will do. Let me know!
Answer by Masterben135 · Jan 30 at 11:11 PM
I don't believe SpriteRenderer is intended to be used on a Canvas. Even if it works, your UI will be drawn on top of the camera in "Screen Space," while the Sprite will likely be behind the Canvas in "World Space."
You could use an "Image" Component if you want the sprite displayed on your Canvas. Animating it would likely have to be a custom script that swaps the sprites. But I would recommend that you only use the Canvas for UI elements, while everything else just uses SpriteRenderer off of a Canvas.
I created a new scene with no canvas and added the playerobject with the sprite in spriterenderer and the sprite is still not visible.
There could be something wrong with your Player32x32_0 asset. It should be imported as a Sprite. Tutorial: https://www.youtube.com/watch?v=VfAYSWpf7gg
Also be sure that your gameobject isn't facing the wrong way. Sprites are only visible from one side.
Answer by bookwormbeekeeper · Feb 20 at 03:16 AM
I found the answer. The sprite was rendered too small to be seen. In the import settings I changed the Pixels Per Unit from 32 to 2. Then the sprite was a reasonable size.
Your answer
Follow this Question
Related Questions
Sprite on SpriteRenderer not keyframing? 1 Answer
Platform Top Panel Scrolling Effect and Animation 0 Answers
sprite animation not playings 0 Answers
Sprite animation 2 Answers
How do I change Sprites (and manipulate the Sprite Object) in C#? 0 Answers