Gotcha. ObjectName() is currently an expression. I’ve suggested in the past that they make it a condition as well.
https://forum.gdevelop.io/t/add-objectname-as-an-object-condition/58637?u=keith_1357
What is your goal? What are you trying to do. A little more context could help.
The problem is that using compare 2 strings would check if an object was name something but it wouldn’t pick the objects. It only evaluates as true or false and triggers the action or the next conditon if true. The same would apply to comparing a scene variable to the object name.
My examples use cursor is on object bc it’s easier for me to test. I use the action to rotate the angle bc that’s a very visual way to tell if an action is triggered.
These don’t really work with multiple objects. If there was only 1 object collision at a time this would work. They say the same thing just from a different direction and condition.
I thought you would be able to use a for each object but that doesn’t work either because there’s still no filtering and it still applies it to all selected objects.
I think the easiest way would be with an object variable. It’s a bit of a work around. When you use an object variable condition, it evaluates to true/false but it also picks the matching objects.
You could use an ID or the object name. An ID might be needed if you’re targeting a particular instance not an object.
Honestly, it depends on what you’re doing. You could also just use an object variable named Target and set it to true for the targeted object and check if the group object variable equals true. Linking is another option.