Reputation: 105
Hello
I try to add sprite to my unity 3D Project, on scene mode my sprite appear but when I start the game on game windows the sprite is not here, do you have an idea why the sprite is missing ?
Thanks a lot Regards
Upvotes: 4
Views: 6296
Reputation: 125275
SpriteRenderer is not a UI component so you shouldn't have it under the Canvas in the Hierarchy.
1.Move the Sprite Object from the Hierachy tab so that it's not a child of the Canvas.
2.Once you do this, you now have to reset the position of the Sprite to see it in the Game view. Start with making the position to be 0
,0
,0
then modify it from there. Also, the scale is too much. You may want to start with the default scale of 1
,1
,1
then move up from there.
It's always a good idea to make the x
,y
,z
axis of the scale to be the-same. Currently they are not. If you want to change one dimension of a Sprite, it's better to modify the Sprite size with a 2D software like Photoshop. You will likely run into physics issue when you do this inside Unity.
See this post for difference between SpriteRenderer
and UI objects such as the Image
and RawImage
components and when to use each one.
Upvotes: 5