0
\$\begingroup\$

I am basically trying to recreate this sample image

enter image description here

from this sprite sheet

enter image description here

(Source)

I split the sprite sheet in the sprite editor of unity, now I want to use the top left texture for ground. But when I add UI->Raw Image, I cannot add the split texture to the texture source. How do I add it as a texture? In the source it does not show the split assets but the full sprite sheet.

How do I add this one single texture? That I have already split in the unity sprite editor.

\$\endgroup\$
  • 1
    \$\begingroup\$ Why do you want to use it as a Raw Image instead of an Image or Sprite? Populating a Raw Image from a spritesheet is somewhat unusual — typically we resort to Raw Image only for content that's generated at runtime, like RenderTextures. \$\endgroup\$ – DMGregory Sep 4 '17 at 19:10
  • \$\begingroup\$ I dont know. I guess the unity game dev course I am following stated that textures are input as raw images. Is this wrong? \$\endgroup\$ – StuckInPhD Sep 5 '17 at 5:15
  • 1
    \$\begingroup\$ Depending on the context, they might have been saying that you can import any common image format into Unity, and it will handle converting it to a game-ready format. (So it's "raw" in the sense that you didn't need to do special baking steps before bringing it into your project, rather than the sense of the RawImage component) \$\endgroup\$ – DMGregory Sep 5 '17 at 11:40
1
\$\begingroup\$

As the comments state, RawImage is for showing textures, but what you have are sprites (a thin veneer over parts of a texture). You'll want to use SpriteRenderers or Images instead. I would recommend sprites over images, since you are building a game scene, not a user interface. Note that both images and sprites have the ability to tile their contents.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.