Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 ZenixGrin · Sep 22, 2016 at 04:53 AM · animation2dsprite

Custom 2D armor slots

Hey, I've have an issue that I can't seem to find an answer to. I've been trying to make a fully customizable character, for a RPG i'm starting to work on. I want to make it so that hair style, chest armor, leg armor, eye color is fully custom, and that if you change it in your inventory, it will change your overworld appearance.

Issue is that I don't exactly know how to go about doing that.

I do know that the way to go would be to separate the player into different animations per custom item, having each animation for each item loaded over a base sprite. For example, if you want to change your hair style or color, what would happen is that it will change a single animation over the base character that makes up the hair portion of the character. However, I do not know how to change the animation based on the value of the assigned hair style nor do I even know how to load the hair animation on top of the base player sprite or adjust its positioning via use of code.

Mostly, as of right now, I just want to learn how to create and place the animation over the character and animate it in sync with the base body, as well as switch out the animations based on particular values set based on what is equipped..

alt text

alt text

Let's say, for example, I want to have a custom hair slot that you can change within the game. How would I animate the sprite as a separate entity without having to merge the two spritesheets, as merging them would mean that it would be required to create a character sprite for every hair, armor slot, and weapon slot possibility, which would be extremely time consuming.

hair1.png (3.1 kB)
male.png (8.4 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by juicyz · Sep 22, 2016 at 06:39 PM

I believe how this is normally done is that you would have an overarching player gameobject. Let's call this Player. Under Player you would create other gameobjects that relate to other aspects. Let's call one Hair and another Shoes.

So now in the inspector you have something like:

 Player
 --> Hair
 --> Shoes

Note: You could also make the body game object and that could be the body. I don't normally work in 3D so it's up to you. But as I have it configured above. The Player will hold the body default shape. Then each other component like hair and shoes will also have their individual graphic that could be changed by code changes or gui changes. You will have to make the images the same size overall so the middle will be the same or know for each different type of part the adjustments needed so it would work.

Then in the Player you can animate everything there using code for each component. As the pieces/parts like Shoes and Hair are a subcomponent, they will follow the Player gameobject around.

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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Sprite animation 2 Answers

Animation System in 4.3 1 Answer

Most efficient way to do 2D animation 2 Answers

Anima2d: How to use a single sprite for two paws? 0 Answers

Sprite rotation with animation (2d project) 0 Answers


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