GM:S 1.4 gun is under the player

Discussion in 'Programming' started by ThyagoCabrito, Oct 12, 2019 at 1:25 AM.

  1. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
    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
     
  2. Toque

    Toque Member

    Joined:
    May 25, 2017
    Posts:
    1,047
    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: Oct 12, 2019 at 2:38 AM
  3. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
    now the weapon is not even in the player it is off the map
     
  4. Toque

    Toque Member

    Joined:
    May 25, 2017
    Posts:
    1,047
    I’m really just guessing with the limited information you provided.

    screen shot?
     
  5. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
  6. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
  7. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
    the gun was to stick to the character
     
  8. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,547
    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.
     
  9. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
  10. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
    How to set the depth of the gun to stay on top of the player?
     
  11. ThyagoCabrito

    ThyagoCabrito Member

    Joined:
    Saturday
    Posts:
    8
    upload_2019-10-12_0-35-40.png
    ah now that i saw was thank you very much
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice