- Home /
Creating a sprite that will not move with the camera
How can I create a sprite that will not move with the camera? For example - a small label that will show the score and will always be on the top lef ?
Answer by highpockets · May 28, 2019 at 08:58 AM
Put a canvas in your scene and set the canvas Render Mode to Screen Space - Overlay. Now add a UI Image as a child and use the Rect Transform component to put it where you need it, scale it to size, rotate it, etc.
I added a canvas, dragged my image under it in the heirarchy. The cavnas' Render $$anonymous$$ode was already set to Screen Space - Overlay as default. But the image is still moving along with the camera... (The camera is attached to a different gameobject).
Ok, you said in your question that you always want it to be in the top left?? I'm assu$$anonymous$$g that is on screen. Since now you say you don't want it done like that you can set the Render $$anonymous$$ode to World Space
Or you can just put the sprite image in world space where you want it, angle it to camera and you're set
Answer by k234234w · May 28, 2019 at 07:02 AM
Why use a sprite when you can use Unity UI?
What do you mean? And if I create a Unity UI, how can I fix it to a location that the camera will not follow ?
Your answer
