• 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
3
Question by K1kk0z90_Unity · Jan 03, 2015 at 11:00 AM · animationmecanim

How to animate a property from current value to a given value?

Hi all, Is it possible to create a Mecanim animation that animates a property from its current value to a given value? Example: I want to create an animation that rotates my camera from its current rotation (it could be any rotation) to rotation (0,0,0). Is it possible? Thank you in advance! :)

Comment
Add comment · Show 2
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 jiangzhen · Dec 28, 2015 at 08:05 AM 0
Share

hi friend did you slove this issuse? i have same issuse. i want add scale.x a sprite from current scale.x

avatar image jiangzhen jiangzhen · Dec 28, 2015 at 09:55 AM 0
Share

for my situation , i find a solution add a parent object , children object change scale.x ,parent object change scale.x Too. it is not best ,but simple to work . for example , parent object set scale x to 2, children object have a animation set scale.x in range: 0~0.5 , and finally sprite scale during Animation is 0~1

2 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by Gnorpelzwerg · Dec 28, 2015 at 09:31 AM

Sure, that's possible. Watch the tutorials first, they show everything you'll need,

http://unity3d.com/learn/tutorials/topics/animation

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 Willard720 · Apr 05 at 07:05 PM 0
Share

Id downvote you if I could. Just answer him, not send him the link to every single tutorial on the topic, christ.

avatar image
0

Answer by unity-huunity · Dec 28, 2015 at 09:40 AM

I don't think it is good reason to use Mecanim for that propose. Mechanim is just an animation switcher. If you have variables, I mean if you don't really know whats going to happen, like you don't know with what rotations you will work with, it's better to code that parts. Using plugins like iTween can be a great solution.

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 Gnorpelzwerg · Dec 28, 2015 at 09:53 AM 0
Share

You could combine code and the animation by animating a public script variable "progress" between one and zero as property. Then interpolate between rotation current (which u save first) and destination rotation by "progress" in the void update( ) function.

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

29 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

Related Questions

Retargetable animation 1 Answer

Access Animation States in Mecanim at runtime 1 Answer

Animator idle minimal delay 0 Answers

What are those white curves in the animation transition panel - And can I read it in script? 0 Answers

Mecanim: 2D Blend Trees, Unable to Compute Positions. 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