Legacy GM gun is under the player

T

ThyagoCabrito

Guest
hello well I made a weapon that she follows the mause but she is getting under the player the rest is working this and the code I used to put the weapon in the player
x = obj_heroi.x;
y = obj_heroi.y;
 

Toque

Member
Try
Y=obj_hero -30
Play with the number.


Or did you mean “under” as it’s behind the player and can’t see it?

Or under. It’s below the player?
Code is in the step event??
 
Last edited:
T

ThyagoCabrito

Guest
now the weapon is not even in the player it is off the map
 

FrostyCat

Redemption Seeker
Keep your original code, that part is correct.
Code:
image_angle = point_direction(x, y, mouse_x, mouse_y);
x = obj_heroi.x-5;
y = obj_heroi.y-5;
If your problem is the gun being covered by the player, set the gun's depth to something lower than that of the player. For example, if the player's depth is 0, set the gun's to -1.
 
T

ThyagoCabrito

Guest
How to set the depth of the gun to stay on top of the player?
 
Top