Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by shopguy · Oct 04, 2014 at 04:50 AM · animation2d2d animation

Making transform based animation "snap" when mixing with sprite based animation

I'm working on a 2D game. I have a sprite for the players body which always displays the same image, but the rotation and position is animated. The player has 2 legs, which use frame based animation (5 different images/frames).

I'm trying to build my animations using the Animation and Animator tabs. I have them all built and working with one exception:

The animation that changes the position and rotation is "smooth" between key frames. The animation that changes the sprite images just changes on each frame, not gradually between frames.

Now, obviously I can't make the sprites change gradually, not without some advanced image morphing code... So how do I get the transform based animation to only update at each key, instead of smoothly?

I'm hoping it is just a setting I can change, but I've changed everything I can think of ("Free", "Smooth", "Flat", "Broken" curve related settings), and nothing is producing the results I'm looking for. My animation looks weird if part of it is smooth and the other part is jumpy/frame-based.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Lohoris2 · Nov 28, 2014 at 05:45 PM

Right click, Both tangents --> Constants

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
avatar image
0

Answer by shopguy · Oct 04, 2014 at 05:10 AM

Guess I just didn't look hard enough before asking, sigh... for future readers...

You have to click on "Curves". A little tab/button currently in the lower left area of the Animation view. You can switch between Dope Sheet and Curves. Once I found the Curves view, it was pretty obvious. Just click a point on the chart, then drag the little end points until the smooth rolling hills looking lines change to 90 degree angles... like steps.

Kind of a crummy solution all around, but to fix my other issue with the Rotation animations not respecting the curve, I created this class and animated the public Rotation property instead. Sucks because I can't preview my animation clips in the editor now, without running the game.

 public class RotationAnimator : MonoBehaviour {
 
     public Vector3 Rotation;
 
     // Use this for initialization
     void Start () {
     
     }
     
     // Update is called once per frame
     void Update () {
         transform.localEulerAngles = Rotation;
     }
 }

Comment
Add comment · Show 2 · 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 shopguy · Oct 04, 2014 at 05:12 AM 0
Share

In my defense, it didn't help that the docs don't match the UI (at least not my UI, on Windows): http://docs.unity3d.com/$$anonymous$$anual/EditingCurves.html -- they show a different method to get to the curve editing, I don't have that option.

avatar image shopguy · Oct 04, 2014 at 05:34 AM 0
Share

Although, this is working for almost everything, Rotation.z is still animated smoothly, even though my "curves" are 90 degree angles (straight lines). All of the other properties work correctly, but no the Rotation.z animation. I may create a small sample project to recreate a submit a bug report, if nobody has a better answer.

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

28 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

Related Questions

Sprite-based animation not loading with Animation component 0 Answers

Need help on skeletal Animation 0 Answers

Idle Animation Not Playing 1 Answer

Need script to do something when animation finished ? 1 Answer

Animation doesn´t save the direction of capsule collider 2D 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