• 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!

GML Visual Invisible Object

Hi everyone! I'm new in this community but I joined just for your help!

I have made an object which if i press E it should change into another object but with different texture.
The problem is, when it changes to the second object, the object seem to not have the texture because is invisible!

I've checked everything! If there are blank frames, checked VISIBLE, never used the draw event...

Please help me!
 

Rob

Member
If it's just the image that you want to change then you can just use

Code:
sprite_index = //insert the name of the sprite here
You won't need that second object then but I guess it's still important for you to know why it's not working so does the second object have a sprite?

If you have a draw event for the second object and you dont use draw_self or draw_sprite then it won't draw itself - just another thing to check.

[EDIT] I'm sorry - I just noticed the Drag 'n Drop sign so maybe this isn't helpful to you at all :(
 
I know about the change texture block, but i need to change object, because one can move, the second one don't.

Also, only because is in drag and drop my topic, doesn't mean you can't help me! :D
Just tell me if you want a copy of my project to fix it or discover in a better way the problem!
 
First Try this, instead of instance_change code, in First instance, let us check if an object is being created or not!
Code:
///Change object
instance_create(x,y, Second Object );
instance_destroy();
Sorry I just saw you are using D&D; the equivalent will be using "Create Object" block than "Destroy Object" block
Also, Make a test room and place both objects in that room, and see if the second object shows up when the game start,
If it shows that there is some problem in changing instance, but if it didn't show up then the problem is in the second object!

PS: Also, wait for 48 hrs to bump the post! Read the Forum Guidelines!
 
First Try this, instead of instance_change code, in First instance, let us check if an object is being created or not!
Code:
///Change object
instance_create(x,y, Second Object );
instance_destroy();
Sorry I just saw you are using D&D; the equivalent will be using "Create Object" block than "Destroy Object" block
Also, Make a test room and place both objects in that room, and see if the second object shows up when the game start,
If it shows that there is some problem in changing instance, but if it didn't show up then the problem is in the second object!

PS: Also, wait for 48 hrs to bump the post! Read the Forum Guidelines!
I have already tried that, no results. When I try to put it into a room it just don't have the texture, but is there, because after the "end" of the animation it will change to the 3rd object (which don't have any problem)

PS: I'm really really sorry for that... I'm a noob...
 
Last edited:
Top