YulRun

Hey all, new to spine, recently purchased Pro today, and waiting for a good course on Udemy to go on sale to start getting my feet wet with it.

I plan to use it for an RPG game, where armor/weapons and base skin colours/faces etc are all swappable.

I'm curious how easy it is with the software to sprite swap either within the software itself or within unity.

I was trying to find a video on it to see an example, would each armor piece and base skin colour/face etc all have to be set up as separate skins, or can you simply activate/deactivate slots in a sense?

Cheers
User avatar
YulRun
  • Posts: 4

Jamez0r

There are a couple ways to customize which attachments (sprites) are active - like you said you can manually select which Attachment is active for a Slot. But the best way is to use Skins. A Skin can contain a single attachment (like just a Red Hat) or can contain a whole custom character setup (Red Hat + Green Shirt + Female Face, etc), and you can have multiple Skins active at a time.

This "Mix and Match" example has info on using Skins to customize a character: Mix and Match example

There are also some good tutorial videos on Spine's youtube channel: https://www.youtube.com/user/EsotericSoftware/playlists

And here is the Spine discord server, which has a #resources channel with lots of tutorial stuff: https://discord.gg/TrNJnMmVvs

---

As for setting Skins on the character itself in Unity - you could check out the code I posted here: How to rebuild a Skin in the editor? (I pasted some code the first response by me).

Note that I am using Odin Inspector, so if you want to copy that code directly into a script in Unity and you don't have Odin Inspector you'll have to remove that [ShowIf(...)] attribute.

Also, you can use that script in Editor mode without running the game, but only if you use "ReplaceSkin", and not "AddToSkin". I think "AddToSkin" only works if the game is running (been a while since I tested it).
User avatar
Jamez0r
  • Posts: 321

YulRun

Thanks Jamez0r,

Appreciate all the info! I'll join the discord and take a look at all the examples you posted.

Cheers
User avatar
YulRun
  • Posts: 4

Harald

Thanks for answering and compiling a list Jamez0r,!

I have to add that it is very much recommended to have a look at the official learning and documentation resources, and also to not skip the basics (e.g. the concept of Attachments and Skins in Spine). It will be pretty frustrating along the way when running into troubles if you don't know how things basically work.

You can find a lot of course-like material including videos here:
Spine: Academy

Specifically sections on Skins:
Skins - Spine User Guide
There is also a specific spine-unity documentation page section about skins:
spine-unity Runtime Documentation: Setting Skins

Also have a look at the many example scenes that are included in the spine-unity package in the Spine Examples directory, such as Spine Examples/Other Examples/Mix and Match Skins.
User avatar
Harald

Harri
  • Posts: 3575


Return to Unity