x


Syncing a Seperate Object's Position and Animation with a Playable Character

I have Playable Character and a chair. When the user clicks on the chair I want the character to pull out the chair, sit down, and scoot forward.

I had the idea of creating a chair-pulling out-sit-scoot character animation and one for the chair. My question, will both animations (for the player and chair) run somewhat in sync if fired simultaneously? Or is there another way of dynamically parenting the chair to the player just for the sake of the sitting animation? Or am I going about this completely wrong?

more ▼

asked Feb 26 '10 at 04:02 PM

Justin 1 gravatar image

Justin 1
3 1 2 6

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

1 answer: sort voted first

Well the animations should run in sync if they begin at the same time, but you would also need to make sure that both the player and the chair were positioned correctly. Hypothetically, you could also use the animation editor to call a function which makes the chair a child of one of the character's joints (likely the wrist or whichever part is pulling the chair), and then calls another function to un-child once it has been moved (when you don't want it to move with the character anymore).

Since you can call things from within the unity animation editor you could call a parenting function like this:

chairObject.parent = playerObject;

In case you haven't really used the animation editor (I'm not very experienced with it myself) http://unity3d.com/support/documentation/Components/animeditor-AnimationEvents.html

more ▼

answered Feb 26 '10 at 07:53 PM

Jason_DB gravatar image

Jason_DB
1.9k 4 14 36

(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:

x3791
x1095
x1044
x45

asked: Feb 26 '10 at 04:02 PM

Seen: 1974 times

Last Updated: Feb 26 '10 at 08:07 PM