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
0
Question by cschlue · Mar 17, 2015 at 10:33 AM · animationanimatorstate-machine2d character

Transform rotation animation no longer works with version 5

A few days ago I decided to start playing around in unity3d and started a new project in version 4, after getting things the way I liked them I noticed version 5 had been released so I downloaded and upgraded it.

I had built a simple 2d sprite and wrote a player controller script in C# using a rigidbody (not rigidbody2D) and 2d sprite renderer. From there I have a animation state machine that sets the sprite in the 2d sprite renderer based on raw horizontal and vertical axis input to face the character in the correct direction. From that state I check if the axis is still pressed in that direction and go to a state that has an animation that rotates the transform of the object to create a southpark style jerky walk animation, In version 4 this works just fine, theirs a link below that shows it in action. In version 5 this no longer works for some reason, when I upgraded my project I had to redo my state machine, which wasn't too surprising. I set it back up exactly the same way and everything works as expected except the transform animation which does not play at all during run time, it does work if I open the animation window and play the keyframes outside of the runtime however.

This error also spams in my log on game start.

     NullReferenceException: Object reference not set to an instance of an object
       at UnityEditor.Graphs.AnimationStateMachine.TransitionEditionContext.BuildNames () [0x00095] in C:\buildslave\unity\build\Editor\Graphs\UnityEditor.Graphs\AnimationStateMachine\TransitionEditionContext.cs:44 
     
       at UnityEditor.Graphs.AnimationStateMachine.TransitionEditionContext..ctor (UnityEditor.Animations.AnimatorTransitionBase aTransition, UnityEditor.Animations.AnimatorState aSourceState, UnityEditor.Animations.AnimatorStateMachine aSourceStateMachine, UnityEditor.Animations.AnimatorStateMachine aOwnerStateMachine) [0x00023] in C:\buildslave\unity\build\Editor\Graphs\UnityEditor.Graphs\AnimationStateMachine\TransitionEditionContext.cs:28 
     
       at UnityEditor.Graphs.AnimationStateMachine.AnimatorTransitionInspectorBase.ComputeTransitionContexts () [0x00068] in C:\buildslave\unity\build\Editor\Graphs\UnityEditor.Graphs\AnimationStateMachine\AnimatorTransitionInspectorBase.cs:125 
     
       at UnityEditor.Graphs.AnimationStateMachine.AnimatorTransitionInspectorBase.OnEnable () [0x00183] in C:\buildslave\unity\build\Editor\Graphs\UnityEditor.Graphs\AnimationStateMachine\AnimatorTransitionInspectorBase.cs:87 
     
       at UnityEditor.Graphs.AnimationStateMachine.AnimatorStateTransitionInspector.OnEnable () [0x00000] in C:\buildslave\unity\build\Editor\Graphs\UnityEditor.Graphs\AnimationStateMachine\AnimatorStateTransitionInspector.cs:55 
 

I have a webplayer runtime I compiled before updating to 5 if you'd like to see how the animation should look.

http://dl.dropboxusercontent.com/u/79418017/tinyterror/gametest.html (wasd for movement)

I'm guessing the issue is partially due to the reworked physics in version 5 since my speed/force values needed to be changed as well for rigidbody.addForce, or is this due to something else? I'd also like to know if this is even the right way to control a 2d object in 3d space (I'd use a rigidbody2d but I need to be able to move on all 3 axis) should I be using a different method to animate the character for the walk cycle? animating the transform of an object with a rigidbody seemed like kind of a hacky way to do it and I'm not sure if I should use 2d sprites for something like this. Is there a better method to have a 2d player in a 3d world? I'd use a plane but it doesn't support sprite sheets, and on top of that it results in a lot of adjustment to remove stretching the texture.

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

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.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Transform rotation animation no longer works with version 5 0 Answers

Easier way of creating transitions in the animator? 1 Answer

Firing triggers and playing animations in sequence 0 Answers

Animate only after certain time 1 Answer

Mecanim. Why cant I get current state name? 1 Answer


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