• 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 /
  • Help Room /
avatar image
0
Question by Minarstilis · Dec 23, 2016 at 04:08 AM · animationuihide

How to show and hide a Button and don't affect the Animation on it.

A Button has Animation to controll it's Alpha of and Scale. i want to hide the Button and let the animation still running . And when i show the Button, it will at some frame of the Animation.

So, i can't use SetActive or change the alpha or size of the Button.

I try to change the Button's Layer runtime to a non culling mask Layer of Camera, the Button is a child of a Panel, the Panel is in UI Layer, i don't know why it is can't work.

What should I do?

Comment
Add comment · Show 3
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 TBruce · Dec 23, 2016 at 05:48 AM 0
Share

You can do this by first by selecting the button in the hierarchy, then right click the button and select UI\Image.

Set the source image reference of the image to the sprite that you want to animate. You will now need to size the image object and move in on the button where you want. Next you need to add/create your animation on this new image object.

Once this is done test to make sure that everything looks correct. Now all you need to do is change the parenting of the game object with the image and the animation to fall directly under the canvas.

Now you can activate/deactivate the button all you want and it will not affect the animation.

Here is a sample video showing how to set it up.

avatar image Minarstilis TBruce · Dec 23, 2016 at 07:26 AM 0
Share

Thank you very much. But I'm sorry I think i didn't explain my question clear.

The animation actually controll the alpha and size of the button. I want to make the button invisible and the animation is still running . So when i make it visible, the button will at some frame of the animation. I just want the button don't renderer on the scene, but i don't know how to write.

avatar image Minarstilis TBruce · Dec 23, 2016 at 09:02 AM 0
Share

I got two ways : 1. someButton.GetComponent().EnableRectClipping(new Rect(0, 0, 0, 0)); 2. Select the type of Image to Filled. And set the value of fillAmount.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

176 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 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 animate a RawImage in UI with a series of PNG files?,How to animate a Raw Image in UI with a series of seperate PNGs? 1 Answer

Need Help With Basketball Game 1 Answer

Can I make a dynamic wave ui with shader ? 0 Answers

Animated Icon in Unity Dropdown Menu 0 Answers

Help, problems with code.... (newbie) 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges