Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
4 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TomMakesGames · Jan 20 at 11:51 AM · spritesspritesheet

How do I take part of a large spritesheet and split it into a number of smaller ones?

I have one big spritesheet which has enemies, player, objects, platforms etc. on it in one block.

I want to separate out player sprites, enemy sprites, ground sprites etc. into different objects/textures.

How do I do this?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by TomMakesGames · Feb 08 at 02:29 PM

So, coming back here after doing something else and realising the solution....

You can have one spritesheet like shown. Use the sprite editor to slice it up. Then select which frames you want to use in an animation Create animations, animators etc. with those frames. You can still use a sprite to represent your stationary player/npc in the scene. You can also select and then drag and drop those sprites onto the tilemap and paint them into the level. You can also assign sprites to different objects, all from the one sheet.

All these are different objects, but they are all referring to the same sprite sheet for their visual appearances.

I didn't realise this was so easy until just now. And as others say - this should be more performant.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by privatecontractor · Jan 20 at 01:24 PM

Hi @TomMakesGames ,

(1) From point of rendering graphic (reducing amount of draw calls) having biger texture with many small inside is beter than having few... but if you need edit it totally and cut to few separate files use Gimp, Paint... etc

(2) If you have one file with many small graphics, try to use sprite mode Multiple and map sprite for different objects... it's really simple and will allow you to optimise your project

alt text

When you select sprite in Unity, change SpriteMode to Multiple. Then hit SpriteEditor bellow.

alt text

If you don't use it already, will need to import it. Use option Slice, and chose size, etc.

When you finish, in unity resources when you click edited sprite, will you have all of the cuted sprites... And gest bart is than graphic cart will try to render them together.

Hope that help.


spriteeditorbutton.png (49.3 kB)
20220120-141518.png (17.5 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by TomMakesGames · Jan 20 at 01:32 PM

Hi @privatecontractor, and thanks for replying.

I know how to do all of that - the importing, slicing etc. But then I end up with 1 big spritesheet with 400 or so sprites in it.

But how can I separate out the player character sprites to go with a player character gameObject? Or the enemy? Or separate out the background, foreground tiles etc.

In another scenario, I might have downloaded 15 frames for a player, another 20 frame sprite sheet for an enemy, and so on. But here they're all included in one massive one. I get the point about draw calls. So is there a way to point/reference certain frames/sprites in this one spritesheet from another object then? Is that the best way? Or am I better off just manually dividing this up in GIMP etc.?

I've attached what I had already. But what's the best way to partition this out for the various functions represented here?

Hope that all makes sense! alt text


spriteeditor.jpg (159.1 kB)
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image privatecontractor · Jan 20 at 02:17 PM 0
Share

Hi @TomMakesGames,

So is there a way to point/reference certain frames/sprites in this one spritesheet from another object then?

Look at picture from my screen, this is one big sprite cuted as we speak above. have all of pieces listed and can use them for serialization in different parts of project. Just drag selected and drop to [Serializedfield] Is this what you looking for? https://ibb.co/GsKbRRQ

Is that the best way?

Depends from loots of staff: (+) prefered to having single file for character (like player/ enemy type) it easier to manage (add remove, etc...). (+) always trying to have all of sprites of particle systems in one file for one materia (-) Of course each file will generate new draw call

Or am I better off just manually dividing this up in GIMP etc.?

Don't know your project, I having player character frames in one, enemys in second file (each have 4 frames- sprites for 4 direction) works perfectly.

You can always check both solutions and check what running smoother or designated machine/ platform.

Hope that helped

avatar image TomMakesGames privatecontractor · Jan 26 at 11:24 AM 0
Share

Hi there, been ill so couldn't return. I think it might be easier to just cut up the file into separate bits.

But I was hoping that there was some way to have gameobjects within Unity reference just certain frames within the sprite sheet. i.e. There's one file, but then you have a sprite which is actually frames 50-60 for the player, another sprite which is frame 10-20 for an enemy etc.

I looked at sprite maps, but that doesn't seem to be what I want.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

137 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to display a single frame of a sprite animation 1 Answer

Jagged edges on spritesheet animation 0 Answers

How do I get edges to form to the sprite shape and not a block around the sprite? 0 Answers

Spritesheets and Unity: best practices 1 Answer

Sprites are not batching, too many draw calls 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges