How to implement seperate arms on a body for collision

micksolomicksolo Member Posts: 264
edited November -1 in Working with GS (Mac)
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!

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    if you open GS creator and in the NEW+ area search 'rotate'. I think the Rotate around mouse and the chainsaw templates might help you. You need to double click them when they appear.

    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 :D

    Good luck!
  • micksolomicksolo Member Posts: 264
    Thanks Simo, that was very helpful. That sin and cos formula worked better but I was still suffering the same problems, when the actor fell over the arms would appear in mid air. Albeit, it was working much better.

    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.
Sign In or Register to comment.