D
dawson2223
Guest
Hey,
I am trying to add a fire animation at the tip of my gun. for this I am using an instance_create in the step event when the gun fires and used length_dir so I could measure the tip of the gun from the origin... (Gun origin was 8,14. Gun tip was 26,5... Difference brings me to 18,9).
My code was:
It works fine when the gun is facing a horizontal direction. the instance is created right at the tip of the gun wherever it is pointing... However, when the gun is facing up or down, the object gets created in the center of the gun instead of the tip... I don't understand why. Can anyone help?
Thanks!
I am trying to add a fire animation at the tip of my gun. for this I am using an instance_create in the step event when the gun fires and used length_dir so I could measure the tip of the gun from the origin... (Gun origin was 8,14. Gun tip was 26,5... Difference brings me to 18,9).
My code was:
Code:
instance_create(x + lengthdir_x(18,image_angle),y + lengthdir_y(9,image_angle),obj_testing);
Thanks!