Multiple NPC's variables / groups

Hi people,

The scenario is as follows: I have multiple NPC’s in a group and i want each of them when hovered to update a “state” variable.
When an NPC is hovered some things happen individually. I’ve looked at this too much I think and can’t see the flaw.
Here are the events i’m using.

1 Like

Not sure but:
I think Pick the NPC that is nearest to CursorX();CursorY() is needless.
GDevelop picks only the instance that applies previous, related conditions.
Toggle disable all those and try:
The touch/cursor is on NPC && Trigger once :arrow_right: Tween the opacity…
:repeat: The touch/cursor is on NPC && Trigger once :arrow_right: Tween the opacity…
If you want all NPCs to take actions (All for one and one for all :stuck_out_tongue:), add Pick all instances.

Hey, thanks for replying.
I’ve tried the simple method you’ve suggested before. The problem is that somehow if i hover one of the NPC’s the Interaction zone would show up over another NPC instance. Also, trigger once doesn’t seem to be compatible with what i’m trying to do as it creates some… undesirable effects such as the zone appears over the previous NPC i’ve hovered or… doesn’t appear at all.
Anyway I figured it out in the end. Pick NPC needed to be the first condition in the chain before anything else. :smiley: