Is this a Bug or Because Im Dumb Please Enlighten me

hello does anyone have encounter the same bug i think if so how do you solved it
even though i put the object variable declaration after the variable is created it still affect all the objects inside the scene
even though my goal is to set the variable only to the newly created one

Those events should only affect the object just created. Maybe there are other events that change the values?

1 Like

Thank you for the reply Unfortunately this is the only event that declares the value if i disabled the declaration of variables and create it only has its own defualt values which is this

Ok. Is there anywhere that modifies the variables?

Yes there it is but i think its not the cause since right after the craetion all the instance of the object is being updated


this code is not always running

I think it’s intended bc it’s picking objects with the collision conditions. I’ve had similar weird things happen when setting object variables before an object is created. In that case, setting the object variables picked the objects.

You could use a condition to filter out all but the new object whether it’s by checking a property like location or an object variable.

I tested this as an example. I like to rotate objects for quick visual feedback. It’s easier than using the debugger to see which objects were affected.

You could set an object variable’s default value to 0 or I like -1. Just make sure any objects created in the editor aren’t set to -1.

Without the extra condition, both objects get rotated.

The object picking extension has an unpick all function. It’s the opposite of pick all. I wish that was a built-in action/condition.

1 Like

So is it correct that when it does run the values seem to get reset whenever a new Water_Dispenser object is created?

How does that figure? The objects in the conditions are different to those getting the variables set.

Sorry about that. The names seemed similar. What objects are in the structures group.

2 Likes

Thank you guys i think i stick to this solution
whenever a new object crated it has a “IsSetupDone” Variable Boolean default false and when setup is finished it will turn into true so that only false objects needs to setup

1 Like

I got the Idea i think the engine give me all the objects since they met my condition which is this


Thanks Thanks i keep that in mind

For better efficiency, I’d recommend you have an event with just the condition and put the repeat (without the condition) as a subevent off that.

Actually, you could do away with that repeat event and just have the subevent as the main event. Then all Water_Dispenser objects that meet the conditions will get updated, and you don’t have to trawl through them one at a time.