Forum Discussion
MeshCreator
Mar 28, 2025Copper Contributor
No differentiation between Avatar Triggers
Unity version: 2022.3.34
Mesh version: 5.2414.130
Hello,
I have noticed an issue that appears when you have multiple Avatar Triggers in one scene. The issue is that the scripts attached to them will run regardless of which Trigger zone the avatar enters.
Let's say, I have 2 trigger zones (1 and 2) and both of them have script (doesn't matter if it's the same script or different ones). If the script on Trigger zone 1 do ABC when Avatar Trigger value changed to true and Trigger zone 2 do XYZ when Avatar Trigger value changed to true, both ABC and XYZ will happen regardless if the avatar only entered Trigger zone 1 or Trigger zone 2.
I have tried using different scripts, saved each Avatar Trigger component in different variables, Used different tags but the issue seems to be in the Avatar Trigger logic itself (even having an Avatar trigger game object with no scripts attached to it will trigger the scripts on other game objects). Of course I could have done something wrong, and I would appreciate some guidance if that's the case.
- TrondleCopper Contributor
I have the same issue. In mesh there are two ways to handle trigger collider logic. Avatar triggers happens locally, while on trigger enter gets networked to all avatars. I don't want to use on trigger enter because only the avatar that enters should see the hidden content. Not all avatars in the scene.
However, using avatar trigger, as mentioned above, allows the avatar who enters any trigger collider to see all hidden content, despite them not being called for. Putting conditions, such as limiting the interaction to a specific trigger collider, does nothing as it activates all available avatar trigger component directly. Which means that all avatar trigger components share the same state, instead of being separate. This makes me unable to get a workaround through code. Is there something I have missed?
My use case is to make 'break-out rooms'. By entering a collider the user gets a discussion topic and question to discuss with the other avatars present in the same collider.