Are Object Groups Bugged Currently for Events?

I’m working my way through trying to create a menu with Keyboard/Gamepad navigation.

One of the important items is highlighting the currently selected menu option.

This seems like it would be easy, so I tested this with a single text object first.

  1. Create an event “When Selector is in collision with Start Text” "Change Color to “255;0;0”
  2. Create an event “(Inverted) When Selector is in collision with Start Text” "Change Color to “255;255;255”
  3. Add “Trigger Once” to both events.

The above works just fine for the first option.

(Start Text selected)
(Start Text not selected)
(Going back to Start Text again highlights it)

However, when I target the group of objects (MenuGroup) that contains both “Start Text” and “Options”, the above does not work after changing all instances of “Start Text” to “MenuGroup”

After making the above tweaks, upon initial load the “Start Text” object will be highlighted. Switching options will set start text back to white, but will not make “Options Text” object red. Additionally, going back to “Start Text” object does not make it turn red again.

If I remove the “Trigger Once” it works, but then every single menu option is being checked every single time, which seems like it reduces any effeciencies gained.

Additionally, this isn’t just collision detection related. I can use “If X/Y position is in MenuGroup.X()/Y()” with the same results if I use Trigger once. Even using variables doesn’t seem to work unless I remove Trigger Once. I tried making it so the collision/position events just set an object variable to 1/0, and then change the color of all group members based on whether that object variable was 1 or 0, but it has the same behavior.

I’ve also tried a “For Each”, but that also doesn’t work unless I remove all trigger once.

Is something broken about Groups? Am I misunderstanding and they aren’t intended for any collision based events?

Sorry working fine for me without loop, with groups :nerd_face:

game file
Just add a sprite on Sprite object, also Sprite object is draggable.

1 Like

Mine are currently in external events that are linked to the scene. Could that be related?

It can’t work with a trigger once because you’re using groups.
When menuselector isn’t in collision with one element of the group, it’s still in collision with another element of the same group, so the condition remains valid, so the trigger once isn’t reset.
I thought for each would be necessary, but I removed them from my circular menu and it’s still working :man_shrugging:

1 Like

Is there another way that I should do this, then?

Not sure how else I could accomplish the idea without the object group or manually coding each option. Not using trigger once in this situation would run into performance issues, right?

Or am I missing something?

I tried with 360 elements, it’s still very smooth, except for some strange bug at right angles. :man_shrugging:

1 Like

I guess I’ll have to use it without trigger once. Even tried using the same object for each option (and renaming each one based on a “Name” variable)

This just shows we really need a way to go This/This Object beyond just collision, but I may be trying to do something a bit too complex.

Thanks all!