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 NovacainE2 · Jan 31, 2017 at 08:24 PM · animationsprite2d gamehide

Hide parts of the sprite in 2D?

Hello all! I don't know if I can clearly express what I am trying to achieve here but I will do my best.

I have a 2D project and I am working with sprites. One of my sprites is a creature that is instantiated every time my game begins. The appearance of the creature is based on some values they are assigned to it, and calculated randomly once the game begins.

The main characteristics of my sprites are horns and stripes. And I want to hide them if a value is lower than a fixed number. For example:

if the value of the horns is lower than the float number 20 then I want to show only the horns in the head. Not all the horns of my sprite. If the horns number is higher than 20, I want to show the horns in the back of my sprite as well. Same goes for stripes too, If the stripes number is lower than 20, then I want to see only the stripes in the head. Is there any way to achieve this? I have tried taking the original sprite and adding to it different children so I can activate them with layers. For example, the horns in the head are now a different sprite which is a child of the creature - sprite and I can activate them via script. But once I do that(add sprite children to the parent creature) , I am not able to assign on the sprite editor since it is now a prefab and not an image. Furthermore, since I already have animation for walking how can I pass an animation with parts of the sprite enabled or disabled? Even if I manage to assign the prefab on the sprite editor somehow, that would still be only one sprite as opposed for the 8 I have for my animation. Picture I use for my animation. I have sliced it in 8 16x16 windows so I can animate them.

I don't know how I can achieve this, thus I am asking for some advices and ideas! Hope I made some sense on what I am trying to do! Thanks for reading! Maybe this needs to go under Animation, dunno yet :(

level3-spikes.png (1.7 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

0 Replies

· Add your reply
  • Sort: 

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

A little question about sprites and RAM on a specific device?? 1 Answer

Is there a way to Update SpriteSheets without having to remake all the animations?? 1 Answer

2D Animated Background 0 Answers

How to call an sprite animation, hide the main character and show him again in another spot? 2 Answers

The parts of my character disappear when i use the animation 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