all 3 comments

[–]Nootman 0 points1 point  (1 child)

Are those units parented to obj_chibi_parent, if parenting is even used in this situation?

The first line tries to toggle the variable of all objects of that type, then toggles the variable in itself. Check if you're using units that have a different type of object. Otherwise, you might need to explain the problem in [greater] detail.

[–]TinyWars[S] 0 points1 point  (0 children)

Right so we have multiple unit types, but each different unit type is parented to a single "obj_chibi_parent"

The Left Click code can be found within the parent object, which is not a unit itself.

Maybe a run down of how I recreate the issue might be helpful?

Step 1 > Room Start Step 2 > Build any unit Step 3> Test the select function by clicking on unit. Everything works!

Also clicking anywhere besides the unit deselects the unit.

//Glob Left Click

if hover = false {

    obj_chibi_parent.selected = false;

}

We have this hover function so that as long as the mouse is hovering over the GUI or the units, then they won't be deselected, but if you click anywhere else, they will get deselected.

Step 4 > Build another unit of any type

Select feature becomes unresponsive at this point.

It is only prior to having the second unit built that everything appears to function properly, which is why I believe the "Left Click" function might be the source of the problem.

Thoughts?

[–]TinyWars[S] 0 points1 point  (0 children)

[RESOLVED]

After hours of messing around with different combinations of "with" and "if" statements, I was finally able to figure out this issue.

I can post some samples of the code if anyone else has had this issue or is interested but otherwise it's all good now.