L
LawH
Guest
When I create an object using a with statement in another object, basically like this;
//In obj_group
with create_obj_unit {
this = other.this;
}
Does this mean that "this" will forever be connected to the obj_group "this", or can the variable now live it's own life in the newly created object?
I thought it would be so, but after a little testing, it seem that the obj_unit.this will change with obj_group.this after creation. There might be a little error somewhere since I am doing testing, but just to know whether these two objects are now connected forever or the variable will not change according to the other object once it has been created?
EDIT: Just to add, does it also depend on naming them the same or something different? If one creates multiple units using a for loop, then all of those units would share the same variable, when in fact the variable should be different. This feels strange to me.
//In obj_group
with create_obj_unit {
this = other.this;
}
Does this mean that "this" will forever be connected to the obj_group "this", or can the variable now live it's own life in the newly created object?
I thought it would be so, but after a little testing, it seem that the obj_unit.this will change with obj_group.this after creation. There might be a little error somewhere since I am doing testing, but just to know whether these two objects are now connected forever or the variable will not change according to the other object once it has been created?
EDIT: Just to add, does it also depend on naming them the same or something different? If one creates multiple units using a for loop, then all of those units would share the same variable, when in fact the variable should be different. This feels strange to me.