1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

My player sprite is invisible.

Discussion in 'Programming' started by Century, May 4, 2019.

  1. Century

    Century Member

    Joined:
    Apr 22, 2019
    Posts:
    16
    I am relatively new to gamemaker and I'm just making something for fun.

    I have run into an issue where my player is entirely invisible. Once again I am new so I don't know what could possibly be causing this.
     
  2. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,201
    Could be many possibilities for this.
    1. Player object is not in the room / or created
    2. Visible box is not ticked in the player object
    3. draw event was added but not completed with drawing the player manually
    4. view is not targeting the player
     
  3. Century

    Century Member

    Joined:
    Apr 22, 2019
    Posts:
    16
    I think i checked all of those. It doesn't work. Can you elaborate on 3?
     
  4. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,201
    In your player object have you added a draw event?
    If so, game maker will remove the automatic drawing of the player and you will have to add code to draw the player yourself.
    Code:
    draw_self();
    
    or
    Code:
    draw_sprite(sprite_index, image_index, x, y);
    
    and the like.
     
  5. Joe Ellis

    Joe Ellis Member

    Joined:
    Aug 30, 2016
    Posts:
    973
    You forgot about the most important one, set the object's sprite,

    @Century if this is the case, find the sprite part of the object window and select one,

    I am aware that this could be going too deep into the beginner help bank, but, i dunno, it seemed a possibility
     
  6. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,037
    You also forgot:

    1b. Player instance's coordinates are too far outside the visible viewing area
    5. Either image_xscale or image_yscale is set to 0
    6. image_alpha is set to 0
    7. The player's depth or layer is too high such that a tile or other instance at a lower depth is covering the player
    8. The background is set as a foreground
    9. Something in the GUI event is drawing over the player such that it completely obstructs the player
    10. You set the variable visible to 0 or lower
    11. You set the variable sprite_index to a negative value
    12. The blend mode was changed to not properly render the player (doubt that's your issue)
    13. Medical science has turned your player instance into the Invisible Man, like Kevin Bacon
     
    Simon Gust likes this.
  7. Century

    Century Member

    Joined:
    Apr 22, 2019
    Posts:
    16
    I don't see how any of this could have happened.

    A while ago I was doing a tutorial and suddenly my player sprite became invisible. I could see others but not this one.
    I have just re-installed the program. It seems to be crossing projects.
    This makes no sense.
     
  8. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,037
    What do you mean across multiple projects? Were each of these projects created following the same tutorial? Or following tutorials by the same person? If it's only one instance that is invisible, it has to be something particular to the object of that instance. What tutorial were you following? At what point in the tutorial did the player suddenly start disappearing? To be blunt, you've given us absolutely nothing to go off of. You have a particular issue which has happened to none of us here, so all we can do is tell you what typical scenarios would result in similar situations. Post your player object's code. Go through all the other objects in the program and make sure none of them are targeting the player in such a way that it would render the player invisible in any of the aforementioned situations.
     
  9. Century

    Century Member

    Joined:
    Apr 22, 2019
    Posts:
    16
    Ok. There are no other objects. This is a new project. I was following a course by Shaun Spalding, linked here. The sprite first went invisible when he started messing around with collision masks, but none of that has been touched in the second project. Only one project was made during the tutorial. By multiple projects I mean two completely, never linked projects stored on different drives.

    The object code is below:

    Code:
    var l02786658_0;
    l02786658_0 = keyboard_check_pressed(ord("W"));
    if (l02786658_0)
    {
        direction = 90;
    }
    
    var l3475615A_0;
    l3475615A_0 = keyboard_check_pressed(ord("S"));
    if (l3475615A_0)
    {
        direction = 270;
    }
    
    var l731C8EDE_0;
    l731C8EDE_0 = keyboard_check_pressed(ord("A"));
    if (l731C8EDE_0)
    {
        direction = 180;
    }
    
    var l06555567_0;
    l06555567_0 = keyboard_check_pressed(ord("D"));
    if (l06555567_0)
    {
        direction = 0;
    }
    This is converted from DnD. I don't know if this is the code you meant.

    I think that is all you requested.
     
  10. Century

    Century Member

    Joined:
    Apr 22, 2019
    Posts:
    16
    Ok. Welp. There was another room the game was auto starting on. Sorry for wasting time.

    The room was entirely empty (I was going to put something there later)
     
  11. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,037
    14. You are in a room from which the player instance is missing.
    Wait, that was scenario 1.
     
    rIKmAN likes this.

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