# Variable not set before reading it error in GameMaker Studio 2

I am following along with a guide. I'm trying to reference code from an instance in my room, but whenever I try to run the script I get this error:

ERROR in action number 1 of Create Event for object objSmileyFace:

Variable objHealth.(100004, -2147483648) not set before reading it.

at gml_Object_objSmileyFace_Create_0 (line 4) - objHealth.playerHealth = objHealth.playerHealth + 10;

gml_Object_objSmileyFace_Create_0 (line 4)

It says objHealth is not set, which is not true. What am I doing wrong?

• "I am following along with a guide" - which guide? Include a link. Sep 5 '20 at 22:44
• A uDemy course created by Aaron Craig called 'Learn To Code by Making Video Games - No Experience Needed!' Sep 6 '20 at 3:34
• Since users trying to help you won't necessarily have that guide to follow, you should edit your question to walk through the steps you took to get here. With that, we should be able to reproduce the problem in a new project, spot steps that might be missing or incorrect, and test potential solutions. Sep 6 '20 at 10:11

The objSmileyFace object is likely created before the objHealth exist.
If you're going to the room where these are defined, check the instance layer and see if both objects are present. and if objHealth is called before objSmileyFace. (priority depends on the order in the instance layer)