Hello community,
Here's an issue I can't seem to figure out after searching for a while.
I gather that this issue could be solved with an instance function which calls for a unique id
but I can't wrap my head around it, here's the details:
In a physics world "obj.A" represents a hand, a hand which creates a "weld joint" on a specific button trigger being pressed with an "if place_meeting obj.B" statement.
Codesnippet from obj.B's (A tool) step event
The issue I am having is that when there are 2 instances of obj.B in my map (on the same x and y location)
the event above triggers twice (which means my single hand holds 2 objects now)
to solve this I think I will have to do something with objects_place (because it returns an id)
but I cannot figure out the right syntax.
How can I make it so, that my hand only picks up one object?
Thanks!
Here's an issue I can't seem to figure out after searching for a while.
I gather that this issue could be solved with an instance function which calls for a unique id
but I can't wrap my head around it, here's the details:
In a physics world "obj.A" represents a hand, a hand which creates a "weld joint" on a specific button trigger being pressed with an "if place_meeting obj.B" statement.
Codesnippet from obj.B's (A tool) step event
Code:
if gamepad_button_check_pressed(global.player1,gp_stickr)
and place_meeting(x,y,obj_phy_front_hand)
and weld = false
{
weld = true
self.phy_position_x = obj_phy_front_handhelper.phy_position_x
self.phy_position_y = obj_phy_front_handhelper.phy_position_y
self.x = obj_phy_front_handhelper.x
self.y = obj_phy_front_handhelper.y
frontweld = physics_joint_weld_create(self,obj_phy_front_handhelper,x,y,0,1,10,0)
}
the event above triggers twice (which means my single hand holds 2 objects now)
to solve this I think I will have to do something with objects_place (because it returns an id)
but I cannot figure out the right syntax.
How can I make it so, that my hand only picks up one object?
Thanks!