Manipulating animation positions via script?

Hi there,

I am trying to make a boxing game just for fun (I dont expect the end product to be anything decent lol) . I have my boxers in the ring and they are animated quite well so far, with Idle, and punch Left and Right. They also rotate so they are always looking at each other.

What I want to do is give the punch some aim towards the head. I will give the punch a set amount which it can move from the standard animation and move the hand bone in the direction of the targets head object. But I don’t know how to do this :S

So far i have used dragged the 3 animation files into Mecanim and coded it to do the animations when a button is pressed.

Is there a way to manipulate the animation in this way? (ie. actually make the arm reach towards the target object )

There’s IK

1 Like

thank you. Since i wrote the first message I have been linked to some stuff about IK. I’m not 100% sure, but I think the MakeHuman mesh and skeleton (sorry I forgot to mention this before) might already have some IK built in. If it does how would I make the right arm “aim” (to a certain set amount) towards the target?

I attach a pic showing what I mean, is this the IK (the floating sphere parts of the model) and if so, what would be a very basic way to manipulate the movement of one of them in code?

The video you attached looks great. Took a little look and assuming I can follow along with it, that should be perfect. I will get stuck into this tomorrow!! thanks , very much appreciated