V
VansiusProductions
Guest
Hi guys,
This is my code. mouseTouch is a variable when it detects that the mouse is touching the object. groupHover is a variable that holds the value of the image_index of the touching object. It will be none if it's not touching any object. Then groupHover's value will be set to either groupSelectedA or groupSelectedB and create 2 instances. groupHover is automatically set to "none" when the object is not touching the mouse. When I click for the first time, the instance for A is created, when I click for the second time and so one nothing happens. Any help?
This is my code. mouseTouch is a variable when it detects that the mouse is touching the object. groupHover is a variable that holds the value of the image_index of the touching object. It will be none if it's not touching any object. Then groupHover's value will be set to either groupSelectedA or groupSelectedB and create 2 instances. groupHover is automatically set to "none" when the object is not touching the mouse. When I click for the first time, the instance for A is created, when I click for the second time and so one nothing happens. Any help?
Code:
if (global.mouseTouch = 1 && global.groupHover != "none") {
if (global.groupSelectedA = "none") {
global.groupSelectedA = global.groupHover
with (instance_create(352,62,obj_group)) {image_speed = 0;image_index = global.groupSelectedA}
exit;
}
if (global.groupSelectedB = "none") {
global.groupSelectedB = global.groupHover
with (instance_create(352,222,obj_group)) {image_speed = 0;image_index = global.groupSelectedB}
exit;
}
}