How to implement seperate arms on a body for collision
Hi,
(I posed in another thread, but there is more info here, sorry about that.)
Basically I'm having a problem implementing separate arms for collision on a human body. The game I'm making requires a man to jump with his arms above his head and catch a ball, but he should only catch the ball if the ball hits his arm (and not another part of his body). This works fine when the man does not rotate.
Currently I have constrained attributes so the arms stick to the body.
ArmPosX to ManPosX
ArmPosY to ManPosY+30 (so the arms are sticking out of his shoulders, and not the middle of his body)
ArmRotation to ManRotation (so the arms rotate the same angle as the man).
The issue I'm having is that when the man rotates, the arms also rotate, but because I have set ArmPosY to ManPosY+ 30, the arms detach from the body. So when the man is lying on the ground, which happens quite often, his arms appear 30pxs above the body in mid air.
Standing state
http://img193.imageshack.us/i/specky1.jpg/
Falling over - as you can see his arms are stuck in mid air, and should be attached to his body pointing right.
http://img140.imageshack.us/i/specky2.png/
I'm thinking the best way to do this is with VectorToAngle, just not sure exactly how to implement it. Any help would be greatly appreciated!
(I posed in another thread, but there is more info here, sorry about that.)
Basically I'm having a problem implementing separate arms for collision on a human body. The game I'm making requires a man to jump with his arms above his head and catch a ball, but he should only catch the ball if the ball hits his arm (and not another part of his body). This works fine when the man does not rotate.
Currently I have constrained attributes so the arms stick to the body.
ArmPosX to ManPosX
ArmPosY to ManPosY+30 (so the arms are sticking out of his shoulders, and not the middle of his body)
ArmRotation to ManRotation (so the arms rotate the same angle as the man).
The issue I'm having is that when the man rotates, the arms also rotate, but because I have set ArmPosY to ManPosY+ 30, the arms detach from the body. So when the man is lying on the ground, which happens quite often, his arms appear 30pxs above the body in mid air.
Standing state
http://img193.imageshack.us/i/specky1.jpg/
Falling over - as you can see his arms are stuck in mid air, and should be attached to his body pointing right.
http://img140.imageshack.us/i/specky2.png/
I'm thinking the best way to do this is with VectorToAngle, just not sure exactly how to implement it. Any help would be greatly appreciated!
Comments
I know the movement is something to do with sin and cos which I see in those projects but I couldn't start to tell you what to do with them
Good luck!
I think I'm going to not try this in my game as my math skills just aren't up to working this out properly and I can get around this part of my game.