Prop Interaction

 

While our character is being chased through the alleyway, I want her to pick up the spray can here so she has a weapon to use against the girl who’s chasing her. Keep in mind, we haven’t animated the girl that’s chasing her yet, but I already know in my head that’s what I want. So since we’ve already animated her doing a roll here and doing the motion of picking up the spray can, let’s figure out exactly how we can get the spray can to stick to her hand dynamically.

The best way to do this is to use constraints. Specifically, the child of constraint. With this we can do something called dynamic parenting. In other words, this child of constraint allows us to key frame its influence, turning it on or off whenever we need to. So how do we add a child of constraint? Well, firstly, let’s scroll up to the frame right before we want the spray can to start following the character’s hand.

We’ll go ahead and insert a key frame for the spray can on this frame so that it stays there until the character picks it up. Then we can go forward one frame and select the spray can. Then click the blue constraints icon in the properties panel. Here, we can select a child of constraint from the dropdown menu.

Since we want to parent the spray can to the hand bone of the character, let’s go ahead and fill this parameter using the armature object of the character rig. Then we can select the hand bone for the bone parameter. However, you might notice that the spray can has disappeared completely. That’s just because it’s snapped to a totally different location after taking the transformation of the character into account. To negate this simply press the set inverse button, which brings the spray can back to its original location while preserving the constraint. Let’s insert a lock rot scale key frame for the spray can in here as well. The last thing we have to do now is key frame the influence for the child of constraint.

Right now, the influence is at 1.0 or 100% for the whole animation. But what we want is for the influence to be 0 before this frame and 1.0 after this frame. So let’s go ahead and right-click the influence slider and select insert key frame. It should turn yellow to signify that there is now a key frame on this frame.

And then let’s move one frame backwards in time and insert another key frame on the influence slider. But this time we drag it down to 0. If you have auto key frame on you just have to drag the value and it will add a key frame automatically after adding the first one previously. If not dragging it and inserting a key frame manually works too.

For hot key users, you can also press I while hovering over the influence slider. This should work for key framing any field slider or parameter outside of the 3D viewport, unless otherwise specified. Now, when we play back our animation, the spray can should be resting before that frame and then following the hand perfectly after that frame.

But you may notice that it doesn’t fit perfectly into the character’s hand. And that’s where you can take some creative liberties. Key framing the spray can so that it moves slowly into position before the viewer notices. Dynamically unparenting object goes a bit like this. First go to the frame where you want to start letting go of the object, set a lock rot scale key frame for the object and set a key frame on the influence slider for 1.0.

Then go to the next frame and press the X button next to the influence slider. This will turn off the influence, but preserve the transformation of the object. You can then insert a key frame for the influence letter for 0.0 and a lock rot scale key frame for the object. But all in all, if you want to make this process a little bit easier, there is also a dynamic parenting add-on for Bunder 2.8, which is free, which I’ll provide in the link down below.

Learning how to use that add-on will also prove useful. I’m going to go ahead and stop this animation before I plan some character interaction as we’ll need to bring in a second character for that. So we’ll be going over that in the next video.