x


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?

more ▼

asked Mar 05 '10 at 11:03 PM

Grimmy gravatar image

Grimmy
533 58 64 69

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered Apr 03 '11 at 09:00 PM

Aubrey Hesselgren gravatar image

Aubrey Hesselgren
287 9 11 19

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Apr 20 '10 at 09:02 AM

Paulius Liekis gravatar image

Paulius Liekis
7.3k 16 24 45

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Aug 08 '12 at 04:31 PM

Futurerobot gravatar image

Futurerobot
109 6 8 9

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3768
x224

asked: Mar 05 '10 at 11:03 PM

Seen: 3097 times

Last Updated: Aug 08 '12 at 04:37 PM