I would recommend to read up on the documentation of
other and it's different meanings. Now, looking at that piece of code my initial reaction is to say that it will either crash, not change the variables of anything or of a single instance. If you want to change the variable in all the instances of
obj_thing
then you can just do (you don't need the
if
):
GML:
with (obj_thing) {
switch_activated = true;
}
If you just want to change the variable for a specific instance of the object then you need to use the instance id instead of the object index. You will either have it already (might be
other
depending on the context) or will need to query for it (for example with
instance_find or another search function).