Mr Awesome
Member
Good morning,
If anyone can help me with this it would be appreciated.
obj_inv_box is created and when my player obj_pl_um_states meets with it in the step event a button prompt appears to press so he can go to the next level. This works fine when I only have one obj_inv_box. But at a certain point I have two obj_inv_box and the collision event only works with the second created box. How do I get it to work with both of them? To be clear, the thing which doesn't work is the button isn't created when he meets global.invboxfire, but is when he meets global.invboxice.
//create obj inv box (2)
global.invboxfire=instance_create_layer(global.toiletTop.x-32,global.toiletTop.y-96,"instances",obj_inv_box)
global.invboxice=instance_create_layer(global.toiletBottom.x-32,global.toiletBottom.y-96,"instances",obj_inv_box)
//step
if place_meeting(x,y,obj_pl_um_states){
instance_create_layer(512,96,"text",obj_button)
}
else{
instance_destroy(obj_button)
}
If anyone can help me with this it would be appreciated.
obj_inv_box is created and when my player obj_pl_um_states meets with it in the step event a button prompt appears to press so he can go to the next level. This works fine when I only have one obj_inv_box. But at a certain point I have two obj_inv_box and the collision event only works with the second created box. How do I get it to work with both of them? To be clear, the thing which doesn't work is the button isn't created when he meets global.invboxfire, but is when he meets global.invboxice.
//create obj inv box (2)
global.invboxfire=instance_create_layer(global.toiletTop.x-32,global.toiletTop.y-96,"instances",obj_inv_box)
global.invboxice=instance_create_layer(global.toiletBottom.x-32,global.toiletBottom.y-96,"instances",obj_inv_box)
//step
if place_meeting(x,y,obj_pl_um_states){
instance_create_layer(512,96,"text",obj_button)
}
else{
instance_destroy(obj_button)
}
Last edited: