0 votes
asked in InteractionSystem by
Hi!

In my game, players can interact with a ball or with other players. But there are times when I want the player to interact only with other players, even if the ball is closer (and vice versa). In other words, I want to get the closest InteractionTrigger that belongs to a player, not any InteractionTrigger. Is there a good way to do that?

Thanks!

1 Answer

0 votes
answered by (19.5k points)

Hey,

Yes, normally you would trigger the closest interaction:

int closestTriggerIndex = interactionSystem.GetClosestTriggerIndex();

But you could foreach through 

interactionSystem.triggersInRange

To find the trigger you were specifically looking for, then call interactionSystem.TriggerInteraction() with the index of the trigger you need.

Best,

Pärtel

Welcome to RootMotion Q&A, where you can ask questions and receive answers from the developer of Final IK and PuppetMaster and other members of the community.

Post as a guest, create an account or login via Facebook.

Please use the correct category when you post your questions.

...