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

<unknown variable> ERROR halp

Status
Not open for further replies.
R

RATTLEGOAT

Guest
trying to make an object disappear on the click of another object. I'm getting this message when I click ANYTHING:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Mouse Event for Glob Left Pressed
for object object15:

Pop :: Execution Error - Variable references invalid object (-4).<unknown variable>
at gml_Object_object15_Mouse_53 (line 3) - objectClicked.object18 = image_alpha = 0;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_object15_Mouse_53 (line 3)

The "unknown variable" is object 18 and it is alive and well. here is my code:

var objectClicked = instance_position(mouse_x,mouse_y,object18 ); //this will either store noone or the id of the instance the mouse is on

objectClicked.object18 = image_alpha = 0;


HALP
 

obscene

Member
objectClicked.object18 = image_alpha = 0;

What even is that? You can't have two equal signs in a single statement. You are storing the ID of the instance of object18 in objectClicked which is correct, but then you type objectClicked.object18 which is the unknown variable since object18 is not a variable of objectClick. So you probably mean to say...

objectClicked.image_alpha = 0;
 
Status
Not open for further replies.
Top