Hi,
I’d like to know how to animate my character to use certain props from the enviroment. For example: playing the guitar, sitting on a chair or grabbing a computer, etc.
I don’t know how to approach this, i never animated anything that required interaction with existing props from the enviroment & i can’t find any tutorial, nor documentation that could clear me out. :I
Imagine picking up a ball for eg. The ball has three states:
- Sitting in initial position/rotation
- handled by user
- Dropped(or thrown)
Parent a sphere to your hand that is from an already animated skeleton.
(Use placeholder props to get pickup location nailed when animating if required.)
The sphere parented to the hand will always be parented, but its renderer enabled and disabled.
scroll to the “pickup” frame of your animation. Duplicate the ball and unparent the new instance. It should remain in the same physical position. This is your “initial” ball.
Scroll to the “throw” frame and duplicate the parented ball again. Unparent the new duplicate, and again it should remain in the same place.
Using animation events to instruct code now you can simply disable and enable the renderers you need to sell the effect, and use whatever technique you need to throw the ball perhaps using physics or keyframe it appropriately.
Alternatively you could look into parenting objects on the fly, which is also quite possibly viable. I have found simply getting the effect looking good is what matters.
var hand: Transform;
var ball: Transform;
function Start(){
Grab();
}
function Grab(){
ball.parent=hand;
}
In the case of a guitar you might want to do the same and parent to the hip. The hip also perhaps with the chair. grabbing the computer the hand but for the second hand, to get it looking right you’re going to need to use IK, or IK tools in your animation program. Getting one hand “slaved” to another is into the intermediate dept and I use Motionbuilder. It might be doable in Unity with pro features available to all. Unsure on that.
Because you end up with a lot of junk on your base model doing this, ball, chair, computer, etc I take this to the next level and do all the props parenting on a cloned animation with invisible character. So my actual characters running around carrying nothing, by he synchronises into position rotation and frame with a second (or third) Other skeleton, and even clips that have no bones in them at all but are just additional object prop animations that also make up the effect- Set to Generic animation rather than humanoid…
Hope that’s helpful but would be interested to hear if anyones done well with the parenting approach.
thank you very much, i’ll start experimenting with this as soon as possible :b