when i shoot bullets with offset(when shooting the bullet would spawn as if the gun is straigh forward even if I have lets say aimed it upwards)
the offset doesnt take gun rotation into the account.
The video of the problem: https://i.stack.imgur.com/Ur24u.jpg.
Heres the gun/shooting code:
x = oPlayer.x + 30;
y = oPlayer.y;
image_angle=point_direction(x,y,mouse_x,mouse_y);
firerate -= 1;
if mouse_check_button_pressed(mb_left)
{
with(instance_create_layer(x + lengthdir_x(50,image_angle) ,y ,"Bullets",oBullet))
{
speed = 20;
direction = other.image_angle;
image_angle = direction;
}
}
Thanks in advance!
[SOLUTION]
edit: after 3 more hours of search I found the solution: