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 alexkuzn · Nov 05, 2015 at 09:08 PM · spriteanimator controlleralpha

Can t change alpha of sprite while animator is enabled.

alt textIn the game should be blue circle, which is hidden until mouse is clicked. After click it appears on screen with animation and after another click it fades with animation. Ball is hidden by script, it changes alpha at start(). But it doesn't change it, as animator is enabled. So in my game I actually see a circle without any clicking. After click it begins to appear from 0 alpha to 1. Why is that? How the problem can be solved without disabling animator?

In the scene I have one sprite (simple blue circle), animator, attached to it and script. Animator has three states: empty state (no animation, set as default), intro (animation: sprite's alpha changes from 0 to 1 and scale) and dead (animation: sprite's alpha changes from 1 to 0 and scale). My script does a few things: at start makes sprites alpha = 0, and after some event set animator's trigger to "Intro". After it is being played, script changes alpha to 1.

untitled-2.jpg (190.2 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 SeasiaInfotechind · Nov 06, 2015 at 05:12 AM

Hi, You can keep your blue circle alpha to 0 prior running any animation, so when you start the game your circle wont be visible.Once you click it will start from alpha 0 to alpha 1. Also if second fading is not working as expected .you can add number of keys reducing alpha value.Check screenshot givenalt text


screen-shot-2015-11-06-at-104447-am.png (236.1 kB)
Comment
Add comment · Show 1 · 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 alexkuzn · Nov 06, 2015 at 09:15 AM 0
Share

You didn't understand me correctly. I have animator, which is playing state with no animation. And while it is being played, I can't change alpha of sprite. Even while game is running, in pause mode, I change alpha in inspector, turn play and alpha reverses back.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Can't animate Sprite correctly 0 Answers

How to change the alpha of a sprite 1 Answer

Transparency When DistanceProblem 0 Answers

Void OnTriggerEnter not working 1 Answer

Change sprite in a sprite renderer with an 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