Hi. I have no idea if I missed a point of something, but this is leaving me completely speechless.
I have this object that is supposed to be picked up by a player. After getting player into certain range it should set a variable to 1, indication that it is in a pickable range. If player is in this range you can press a button to pick it up. Everything is working as it should except that variable.
Problem I have is that only the newest instance of that object is changing that variable. The older ones can still be correctly picked up, but it will not change that variable.
objRedMushroom
STEP:
if collision_circle(self.x,self.y,collisionSize ,obj_player,false,false)
{
objDrawInteractGUI.showPickup = 1;
if gamepad_button_check_pressed(0, gp_face1)
{scrItemPickup(Item.RedMushroom);}
if keyboard_check(ord("Q"))
{scrItemPickup(Item.RedMushroom);}
}
else
{
objDrawInteractGUI.showPickup = 0;
}
If I use a collision event istead for changing the variable it works and every single instance of that object will be able to change it.
Why its not working in a step event? Am I missing something?
I have this object that is supposed to be picked up by a player. After getting player into certain range it should set a variable to 1, indication that it is in a pickable range. If player is in this range you can press a button to pick it up. Everything is working as it should except that variable.
Problem I have is that only the newest instance of that object is changing that variable. The older ones can still be correctly picked up, but it will not change that variable.
objRedMushroom
STEP:
if collision_circle(self.x,self.y,collisionSize ,obj_player,false,false)
{
objDrawInteractGUI.showPickup = 1;
if gamepad_button_check_pressed(0, gp_face1)
{scrItemPickup(Item.RedMushroom);}
if keyboard_check(ord("Q"))
{scrItemPickup(Item.RedMushroom);}
}
else
{
objDrawInteractGUI.showPickup = 0;
}
If I use a collision event istead for changing the variable it works and every single instance of that object will be able to change it.
Why its not working in a step event? Am I missing something?
Last edited: