• 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
2
Question by Grimmy · Mar 05, 2010 at 11:03 PM · animationprefabs

Can the animation editor create local rotational data?

I made a simple animation in the animation editor (a door swinging open) and then save this door with its anim to a prefab. Then when I duplicate the prefab and rotate the door to fit in different doorways the animation always plays from a fixed 'global' rotation ie the start and end positions of the original door..the prefab rotations arent taken into account.

How do I make the animation follow local rotations? If thats not possible it makes the animation system useless for prefabs right?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Futurerobot · Aug 08, 2012 at 04:31 PM

Objects rotate and position themselves in the coordinate system of their parent objects, same when animated. The "local pivot" on the parent shows you the center and orientation of the coordinate system. If you animate the Y position of an object, it will move along the Y direction of the parent coordinate system. Rotations are a bit more fancy but still basically the same.

An object without a parent is basically moving around in the unity world coordinate system. Animations done in the world system will always put the object in the same spot and orientation as you animated them. Moving them around does not have any effect, since the animation controls the position and rotation values while it's running.

In the door example:

Create an empty GameObject and call it for instance "DoorParent", then link the door to it. When you now animate the door opening, the movement is happening in the doorparent coordinate system, and moving the doorparent around allows you to position the door with the animation intact.

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
3

Answer by Aubrey Hesselgren · Apr 03, 2011 at 09:00 PM

As a basic best practice, specifically for the kinds of problems you're getting here, you should only really animate children of the object you've added the animation component to.

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
1

Answer by Paulius-Liekis · Apr 20, 2010 at 09:02 AM

You're doing something wrong (can't really say what). Animations work in "local space", so if you move parent everything should work. If it wasn't supported it wouldn't be possible to do any character controllers using such animation system.

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

1 Person is following this question.

avatar image

Related Questions

How to update keyframes to reflect prefab changes? 0 Answers

how to fix this dont play animation and prefabs?,how to fix this 0 Answers

Rotation problem of two different prefabs 0 Answers

Scripting BUG: target becomes bigger when getting nearer 1 Answer

Quick way to reproduce fully rigged, animated prefabs with different meshes/Materials? 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