0
\$\begingroup\$

In have a 3D world map, and I want to have a 2D UI with top nav/character thumbnail/stats/etc. overlaying it. I figured the best way to do this would be to use a canvas an embed all of UI stuff on it. For reference I'm going to be using this pack for the UI and this character as the thumbnail in case the issue I'm having is specific to these assets.

The character asset comes as a prefab that I tried to just drag and drop on to the canvas but it stays relative to the camera view (i.e. it looks really small on the canvas in scene view but bigger than all canvas elments in game view, and is positioned as it was relative to the world)

Heres some screenshot to help:

That tiny little dot inside the directional light is the sprite "on the canvas" next to the 3D world, you can see him in the camera preview. As you can see it's much smaller than the panel also on the canvas leading off screen. enter image description here

Now when I hit play, he is much bigger than the canvas panel, and still positioned relative to the world:

enter image description here

Why isn't it treating the sprite like he is on the canvas, I tried setting it to the "UI" layer but no affect. It is nested under the canvas in the hierarchy.

Is there an easy way to make it act as a UI element while keeping the animations attached to him. And with the littlest effort as I'll be downloading many more of these sprites so I would prefer not to fully recreate them or anything.

\$\endgroup\$
  • 1
    \$\begingroup\$ @Nikaas interesting didn't know about canvas scalars that sounds like it may fit the bill (atleast for size I'll have to see position). I didn't know about those as I'm still very much learning. I'll check it out thanks! \$\endgroup\$ – DasBeasto Mar 14 '17 at 2:14
  • \$\begingroup\$ If you want to see the sprite in size relative to the canvas i.e. bigger. Then try adding an Image component and set your sprite there. \$\endgroup\$ – Aditya Yadav Mar 18 '17 at 5:13
  • \$\begingroup\$ @AdityaYadav yep! That was it! I added the image component which came with a canvas renderer. Then disabled the sprite renderer. Took care of it. I'll add specifically what I did as an answer but if you want to put it that's pretty much it. \$\endgroup\$ – DasBeasto Mar 18 '17 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.