J
joz gandoz
Guest
Please help me how to make drag and drop object ?
There are two object, simply called it obj_one as source and obj_two as destination. I want to drag/move obj_one to target, obj_two.
1. When left mouse is clicked and hold, I can move obj_one to destination object.
2. When left click is released, and before reaching target it will back to position start.
3. After obj_one reach target or make collision with obj_two : obj_two destroyed, obj_one will snap to obj_two position and no more drag obj_one again.
===
What I have done for obj_one
create event : set variable drag to false
step event :
if drag is equal to true jump to position (mouse_x,mouse_y)
if drag is equal to false jump to start position
left button event :
set variable drag to true
left released event :
set variable drag to false
===
thank you for your help
There are two object, simply called it obj_one as source and obj_two as destination. I want to drag/move obj_one to target, obj_two.
1. When left mouse is clicked and hold, I can move obj_one to destination object.
2. When left click is released, and before reaching target it will back to position start.
3. After obj_one reach target or make collision with obj_two : obj_two destroyed, obj_one will snap to obj_two position and no more drag obj_one again.
===
What I have done for obj_one
create event : set variable drag to false
step event :
if drag is equal to true jump to position (mouse_x,mouse_y)
if drag is equal to false jump to start position
left button event :
set variable drag to true
left released event :
set variable drag to false
===
thank you for your help