flyinian
Member
I am using the parenting system for my navigation system in my project.
Some buttons will go to a room when clicked and others will create instances.
If I use the below code with the buttons that don't go to a room, it will give an error.
Is there a way to have a variable return a value to tell game maker to not give an error and not execute the function?
I know i could add another argument to the if statement and check to see if _GoToRoom returns a room or not.
Some buttons will go to a room when clicked and others will create instances.
If I use the below code with the buttons that don't go to a room, it will give an error.
Is there a way to have a variable return a value to tell game maker to not give an error and not execute the function?
I know i could add another argument to the if statement and check to see if _GoToRoom returns a room or not.
GML:
// Create Event
_GoToRoom = room1;
// Step Event
if (mouse_check_button_pressed(mb_left) && position_meeting(mouse_x,mouse_y, _Object_1))
{
if(room != _GoToRoom)
{
room_goto(_GoToRoom);
};
};