K
Konzash
Guest
So, I have a rotating arm that is a seperate object from the main player sprite. The arm rotates based on the mouse cooridnates and flips the player sprite and arm if it goes behind the current facing direction.
So now, I want to place a weapon object in the hand at the end of the arm, which has it's pivot point at the shoulder, at the opposite end. I also need to rotate the gun based on the direction the arm is pointing, wether it be at the ceiling, straight ahead, or down.
As of right now I can have it the player arm but is sits in place based on the pivot point at the shoulder.
Here is what code I have for the gun following the characters arm object:
if (PlayerOwned=true)
{
if (oPlayer.image_xscale >=0)
{
image_xscale=1;
x=oPlayer_default_arm.x+64;
y=oPlayer_default_arm.y;
} else {
if (oPlayer.image_xscale <=0)
{
image_xscale=-1;
x=oPlayer_default_arm.x-64;
y=oPlayer_default_arm.y-6;
}
}
}
So now, I want to place a weapon object in the hand at the end of the arm, which has it's pivot point at the shoulder, at the opposite end. I also need to rotate the gun based on the direction the arm is pointing, wether it be at the ceiling, straight ahead, or down.
As of right now I can have it the player arm but is sits in place based on the pivot point at the shoulder.
Here is what code I have for the gun following the characters arm object:
if (PlayerOwned=true)
{
if (oPlayer.image_xscale >=0)
{
image_xscale=1;
x=oPlayer_default_arm.x+64;
y=oPlayer_default_arm.y;
} else {
if (oPlayer.image_xscale <=0)
{
image_xscale=-1;
x=oPlayer_default_arm.x-64;
y=oPlayer_default_arm.y-6;
}
}
}