P
Phearcet
Guest
Hi, I'm trying to make a very simple game in which you pick up an object and deliver it to a NPC.
My plan is to set a variable which is set to a specific number upon colliding with the pickup. Then when the player touches the NPC it checks for that number and gives a score if it matches. However, my game keeps crashing whenever I touch the object. Is there anything wrong with my code?
Here's my code for the NPC:
And the code of my pickup:
And here's the crash report
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step EventoPlayer
for object oPickup01:
Variable oPickup01.Pickup(100006, -2147483648) not set before reading it.
at gml_Object_oPickup01_Collision_d722c0b6_a7bd_4053_9bdb_5179db91bb12 (line 1) - if (Pickup = 00)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oPickup01_Collision_d722c0b6_a7bd_4053_9bdb_5179db91bb12 (line 1)
My plan is to set a variable which is set to a specific number upon colliding with the pickup. Then when the player touches the NPC it checks for that number and gives a score if it matches. However, my game keeps crashing whenever I touch the object. Is there anything wrong with my code?
Here's my code for the NPC:
Code:
if (Pickup = 01)
{
Score = Score + 1;
Pickup = 00;
instance_destroy(oNPC01);
}
And the code of my pickup:
Code:
if (Pickup = 00)
{
Pickup = 01;
instance_destroy(oPickup01);
}
And here's the crash report
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step EventoPlayer
for object oPickup01:
Variable oPickup01.Pickup(100006, -2147483648) not set before reading it.
at gml_Object_oPickup01_Collision_d722c0b6_a7bd_4053_9bdb_5179db91bb12 (line 1) - if (Pickup = 00)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_oPickup01_Collision_d722c0b6_a7bd_4053_9bdb_5179db91bb12 (line 1)