My player sprite is invisible.

C

Century

Guest
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.
 

Simon Gust

Member
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
 
C

Century

Guest
I think i checked all of those. It doesn't work. Can you elaborate on 3?
 

Simon Gust

Member
I think i checked all of those. It doesn't work. Can you elaborate on 3?
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.
 

Joe Ellis

Member
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
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
 

TheouAegis

Member
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
 
C

Century

Guest
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.
 

TheouAegis

Member
It seems to be crossing projects.
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.
 
C

Century

Guest
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.
 
C

Century

Guest
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)
 
Top