P
Pylon
Guest
I have an object (uses physics) that I drag around with the mouse.
Create event code looks like this:
depth = -1000;
grab = false;
xx = 0;
yy = 0;
Step event code looks like this:
if(grab==true)
{
xo=phy_position_x+xx;
yo=phy_position_y+yy;
phy_speed_x = mouse_x-xo;
phy_speed_y = mouse_y-yo;
}else{ phy_speed_x = 0;
phy_speed_y = 0;}
Left pressed event code looks like this:
grab = true;
xx=mouse_x-phy_position_x;
yy=mouse_y-phy_position_y;
Global left released event code is this:
grab = false;
I have another object which I use as floor/wall, which has a collision event with my mouse-drag object.
But the object I drag with the mouse still goes through the floor/wall. Any ideas on how to prevent that? Thanks.
All objects and the room use physics.
Create event code looks like this:
depth = -1000;
grab = false;
xx = 0;
yy = 0;
Step event code looks like this:
if(grab==true)
{
xo=phy_position_x+xx;
yo=phy_position_y+yy;
phy_speed_x = mouse_x-xo;
phy_speed_y = mouse_y-yo;
}else{ phy_speed_x = 0;
phy_speed_y = 0;}
Left pressed event code looks like this:
grab = true;
xx=mouse_x-phy_position_x;
yy=mouse_y-phy_position_y;
Global left released event code is this:
grab = false;
I have another object which I use as floor/wall, which has a collision event with my mouse-drag object.
But the object I drag with the mouse still goes through the floor/wall. Any ideas on how to prevent that? Thanks.
All objects and the room use physics.