• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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