x


how to perform an animation interacting with an object of the scene

Hi, I would like to know what are the steps for making an animation that interacts with an object of the scene. More specifically, I would like my character to pick a bowl from the floor and perform an animation with it, after finishing it he would drop it again and leave it just as it was in the scene.

Should I animate both together in 3ds max? How Unity should treat them, as two separate models or becoming one single model when the animation is triggered?

I have read in the documentation about this trying to find out myself which is the best way to face it but I haven't found anything in this respect.

Thank you for your time.

more ▼

asked Aug 27 '12 at 12:58 PM

wuerbo gravatar image

wuerbo
1

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

1 answer: sort voted first

and add extra bone to your character's hand as a bowl and create an animation for your character.

in game : before animation started set

Transform tempParent = bowl.transform.parent;
bowl.transform.parent = extrabone.tramsform;
bowl.transform.localPosition = Vector3.zero;
bowl.transform.localRotation = Quaternion.identity;

after animation ended

bowl.transform.parent = tempParent;
more ▼

answered Aug 27 '12 at 01:13 PM

SkillDev gravatar image

SkillDev
25 1 5

Hi, thanks for your answer. I didn't really understand it that much as I am new to Unity.

I have some questions: How do I remove the mesh of the bowl from the scene when the animation of the character (which will contain the bowl) is loaded? The code you provided: is that a javascript file? to what should I apply it? To the bowl or the character?

Thank you!!

Aug 28 '12 at 11:24 PM wuerbo

Actually you do not need to create a bowl mesh that attached to your character in animation, just add an extra joint as a prop to your character's hand.also you can create some keyframes for prop but it is not necessary. then you can attach anything to prop (like a bowl). The code i provided is in c# and show how to attach another object (like a bowl) to a joint(bone).there is no specific place to write this code it depends on your design scripts.

Aug 29 '12 at 03:23 AM SkillDev
(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:

x3779

asked: Aug 27 '12 at 12:58 PM

Seen: 174 times

Last Updated: Aug 29 '12 at 03:23 AM