M
mitzy
Guest
Hello everyone! I'm very new to Gamemaker and GML and I was wondering if anyone could help me out with a problem I am having.
I am trying to make it so that when an obj_Slider1 is left clicked the sprite for obj_Slider1 switches and that a seperate Object named Obj_Moon turns visible/invisible. I have been able to make the Slider switch sprites back and forth when you click but Obj_Moon is only able to be visible and not invisible. My code is below- any help is appreciated. Thank you!
if (sprite_index == spr_Slider1Left)
{
sprite_index = spr_Slider1Right;
obj_Moon.visible = true
}
//Switches sprites, makes obj_Moon invisible
else if (sprite_index == spr_Slider1Right)
{
sprite_index = spr_Slider1Left;
obj_Moon.visible = false
}
I am trying to make it so that when an obj_Slider1 is left clicked the sprite for obj_Slider1 switches and that a seperate Object named Obj_Moon turns visible/invisible. I have been able to make the Slider switch sprites back and forth when you click but Obj_Moon is only able to be visible and not invisible. My code is below- any help is appreciated. Thank you!
if (sprite_index == spr_Slider1Left)
{
sprite_index = spr_Slider1Right;
obj_Moon.visible = true
}
//Switches sprites, makes obj_Moon invisible
else if (sprite_index == spr_Slider1Right)
{
sprite_index = spr_Slider1Left;
obj_Moon.visible = false
}