K
Kieran Hayns
Guest
Im creating an RTS.
The screen has a control panel.
Yoi select the unit and then when you select the options on the panel it applies to that unit (move, stop, attack move etc)
However when there isent a selected unit or the currently selected unit has been destroyed i want the buttons on the panel to be unusable until a new unit.is selected.
I kept it simple as the control panel stores the Unit_Selected variable and when the button is pushed it says
If instance_exists(Unit_Selected)
{
Do stuff
}
I have also done this as Unit_Selected.id
The problem:
When the unit exists it works however when the instance is destroyed a d i push a button it returns it as undefined rather than as false.
I swear ive done this loads of times and it has worked. What am i doing wrong?
The screen has a control panel.
Yoi select the unit and then when you select the options on the panel it applies to that unit (move, stop, attack move etc)
However when there isent a selected unit or the currently selected unit has been destroyed i want the buttons on the panel to be unusable until a new unit.is selected.
I kept it simple as the control panel stores the Unit_Selected variable and when the button is pushed it says
If instance_exists(Unit_Selected)
{
Do stuff
}
I have also done this as Unit_Selected.id
The problem:
When the unit exists it works however when the instance is destroyed a d i push a button it returns it as undefined rather than as false.
I swear ive done this loads of times and it has worked. What am i doing wrong?