Why does my sprites dissapear after i run the project?

9

902creator

Guest
im sorry if this is a very newbie question, im just starting to get into programming with gamemaker studio anyway after i got into making a project i started to import my custom sprites into my project and after i was done i started with the programing as i just wanted to see how the sprites looked in game before aplying any movement scripts i just made basic code for sprites

sprite_index = (my sprite);
image_index = 0;

image_speed = 1;

and after i was done with that i run the project and what i see? nothing, the sprite dissapeared after that i went to check if i writed anything wrong and apparentely no, so i went to get some internet help by googling my problem surely i can fix this really fast right? well i try with one relpy from someone that had a problem similar to mine

visible = true;
so i run it to test if it worked and....nothing again, i checked again and i tried with the draw events and again the sprite wasn´t there i checked if maybe the layer of background was up from the instances layer but again everything was normal and fine in the project preview of the room but in the project itself , so after that im asking here to see if anyone can help me with my project

again my apologies if this is a very easy to fix problem
 

YoSniper

Member
Is the code you wrote in the Draw Event?

If you have a Draw Event for your object, make sure to include something like
Code:
draw_self();
in it. Otherwise, it won't draw the sprite. Objects without a Draw Event just draw the sprite by default.
 
9

902creator

Guest
Is the code you wrote in the Draw Event?

If you have a Draw Event for your object, make sure to include something like
Code:
draw_self();
in it. Otherwise, it won't draw the sprite. Objects without a Draw Event just draw the sprite by default.
first my code was in the creation code after this relpy i tried pasting it in a draw event with the draw_sprite event but it didnt work again so i tried the draw_self code too and..it doesnt work weirdly i maked another project where instead of importing drawed sprite i tried to make a placeholder and weirdly the placeholder actually showed but when i tried importing the same sprite it doesnt show up

so i have a question does gamemaker have problems when showing a imported sprite? by the sprite editor everything looks fine but what do i know?
 

Toque

Member
So if you assign a different sprite to that object its showing....?

If you have a new project and place that sprite into it does it show? If you create an object and assign that sprite to it. Drag it in. Run. Does it show?

If you delete the draw event in your current project does it work? (oh i think you dont have a draw event.)




I start a new project, drag a new gif in. Assign gif sprite to a object and use this code in my create event.

sprite_index=s_toque_walk;
image_index = 0;
image_speed=1;

And I see it. It works as it should.......
 
Last edited:
9

902creator

Guest
So if you assign a different sprite to that object its showing....?

If you have a new project and place that sprite into it does it show? If you create an object and assign that sprite to it. Drag it in. Run. Does it show?

If you delete the draw event in your current project does it work?
1- yes the object appaers when i change his sprite to a sprite created with the gamemaker sprite editor

2-this maybe will hear stupid but i had many tries of myself with different folders cause i refuse to get help but anyway no it never showns when i import the sprite in this and any of my different folders i have tried deleting both of my codes the creator and draw codes but again nothing

do you know any reason of why only imported sprites dont show up? the type of files i use are gifs is there any problem with that specific type of file?
 

Toque

Member
Gifs are a collection of images. Gifs are fine. Is there a blank image in your gif? And it’s just showing the blank.

I would find a different gif. Place it in the project. place it in that object.

if another gif shows. It’s the sprite. If it doesn’t show it’s your code/ object.

If you have a new object and only that sprite will it show? No code.

I’m guessing it’s your code.
 
9

902creator

Guest
Gifs are a collection of images. Gifs are fine. Is there a blank image in your gif? And it’s just showing the blank.

I would find a different gif. Place it in the project. place it in that object.

if another gif shows. It’s the sprite. If it doesn’t show it’s your code/ object.

If you have a new object and only that sprite will it show? No code.

I’m guessing it’s your code.
Gifs are a collection of images. Gifs are fine. Is there a blank image in your gif? And it’s just showing the blank.

I would find a different gif. Place it in the project. place it in that object.

if another gif shows. It’s the sprite. If it doesn’t show it’s your code/ object.

If you have a new object and only that sprite will it show? No code.

I’m guessing it’s your code.
well i tried both of your solutions and...again i see my good friend the void without objects! i tried with another gif wich is his walking animation but no i see empty void again i tried making a whole new object without any code just with the gif as his main sprite and tada again i see void

then i try making a new folder and do the two methods again and again my good fellow the void appaers, im getting kinda tired of seeing void well any other method i can try? i want to keep going with my project so any other solution? my apologies for the late replie i was getting a little break from all of this
 

Toque

Member
I don’t know. All I can say if I start a new project and use that exact code it works fine.

is there another object covering your sprite? Is your camera view somewhere where you can’t see your Object/ sprite?

In a new project with that sprite as object does it show?

Is there a layer change?
there are no Other events that are destroying the object?. there is no other objects destroying that object?

there is no code moving the object out of view?

if you use a sprite that works in another object into that object does it show?

There is only three lines of code?

No imported sprites work at all?
 
9

902creator

Guest
I don’t know. All I can say if I start a new project and use that exact code it works fine.

is there another object covering your sprite? Is your camera view somewhere where you can’t see your Object/ sprite?

In a new project with that sprite as object does it show?

Is there a layer change?
there are no Other events that are destroying the object?. there is no other objects destroying that object?

there is no code moving the object out of view?

if you use a sprite that works in another object into that object does it show?

There is only three lines of code?

No imported sprites work at all?
1-no im basically with just one object no background no partners i just want to see how my sprite looks in game

2-no i had tried that and no

3-i havent made another layer or even moved the location from the default ones and no there is no code that destroy the object

4-i havent writed any movement code

5-no other objects make the spruite appaer

6-before there was some spite-set codes and it didnt appaer now in this new one no script writed and still it doesn´t appaer

well thanks for trying to help me
 
9

902creator

Guest
update: now not even gamemaker studio sprite editor made sprites show just my friend the void please someone help me i want to continue with this project
 
Top