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 ArcaneTheWoof · Feb 05, 2016 at 01:01 PM · animationstate-machinetransitions

Change Properties on First Frame of Animation

So I have the following state machine setup for a bit of UI:

State Machine Setup

The goal is: when you get a shield, the normal hit bar disappears, the shield bar appears, a shield sprite goes BLAOW and then sits and glows. When you lose the shield, it fades away. Here's the animation setup:

Animation Setup

Notice that I've set the enabled properties of several objects in the first frame, but the particle system isn't enabled until frame seven or so. The problem I'm having is that everything that's supposed to happen in frame one—enabling/disabling objects and setting the scale and colors—doesn't trigger at all. I've tried everything I can think of to convince Unity to play these first frames—I've fiddled with the transition settings, turned looping on/off, etc—and nothing seems to get that first frame to go.

The only thing I can think of is that it's not doing anything because technically nothing is being animated at that point; i.e. there is no previous keyframe to animate from; but that would mean it is impossible to set parameters at the beginning of any animation, which seems wrong, and therefore I must be missing something.

So, what am I doing wrong?

EDIT: Based on my previous suspicion, I tried moving the initial keys to frame two and adding keys with the default values to frame 1, and it does indeed work, which seems to confirm my hypothesis that you can't change properties in frame 1 because they aren't animating from anything, but this still seems like I'm just missing an easier way to do this. Any help would be appreciated because this workaround will get really obnoxious really fast.

animation-setup.png (134.8 kB)
state-machine-setup.png (59.5 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 Masterio · Feb 05, 2016 at 02:21 PM

maybe try make script for Animator States:

https://unity3d.com/learn/tutorials/modules/beginner/5-pre-order-beta/state-machine-behaviours

http://docs.unity3d.com/Manual/StateMachineBehaviours.html

It is very useful thing.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Last frame of animation shows up just before the end 0 Answers

Easier way of creating transitions in the animator? 1 Answer

Why does Unity animator makes calling children's SetActive fail? 0 Answers

Transition Between Regular Animations and Ragdoll Physics 3 Answers

Mecanim transition condition can't have both bool and trigger? 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