EVENTTYPE_SELECT_ON not getting triggered

Hi, I noticed that the event EVENTTYPE_SELECT_ON does not get triggered on the second and fourth click on my object. Is this a bug?

By default, if you click on a selectable element, the SELECT_ON event is triggered and the element becomes selected. The event will not be triggered again on the second click because the object is already selected.

There are two modes of selection, which have different effects on the following clicks:

  • In SINGLE mode, the object will only be unselected if a click happens somewhere else in the scene, or by using the updateSelected() API function.
  • In MULTIPLE mode, the object’s state will be toggled on each new click: first click selects the object, second click unselects it (SELECT_OFF event), third click selects it again, etc… This seems to match you situation.

In any case, if you want to trigger a SELECT_ON event for every click, you should use updateSelected() to unselect the object right after it has been clicked. You are probably already doing things in the event callback so you just have to add a single line at the end of the callback.