Add ObjectName as an object condition

There’s already an ObjectName() expression. It would be so helpful if it was also a condition.
Yes, you can use ObjectName() with the compare 2 strings condition but that doesn’t pick matching objects. You need to put the condition inside a for each object, and that’s not as efficient.

image

Also, it would be easier to just click if from the list of conditions
Currently you need to add a for each object and compare 2 strings condition
ScreenRecorderProject39_1

If you can’t use ObjectName() as a condition then you also can’t do something like pick a random object based on a variable.

The other option is to create an object variable named name for each object and use the object variable condition. Adding object variables to each object seems unnecessary and redundant since objects already have a name parameter.

3 Likes

Maybe im just being a bit slow, but how would you use it?

From what i understand you want a condition that just states, "If Object Name = “insertName”…

Oh! Is it so you can do stuff with variables? like "If Object Name = “Name+Varibale(color)”, or something along those lines?

That would save a bunch of events if dealing with lots of different objects, you could program all sorts of systems using very little event processing.

Or am i missing the point?

1 Like

Yes. The main use is to pick objects by their name similar to the create object by name. They go hand in hand. You can check the animation or text but not all objects have that option and adding object variables can be a pain.

2 Likes

This has my vote then!

Honestly, anywhere expression like that can be added it should be added.

Using expressions to combine variables into values makes stuff so much easier, clean and efficient.