Proximity Demo

Maria Beltran

Search Knowledge Base by Keyword

You are here:

What we want to achieve:

The alien in the audience react when the user is on stage.

How:

  • We assume assets are ready. Alien have all an animator controller with animations and are converted into interactive objects. The other element we need is to detect when the user is on stage, for this we are using a UI where he needs to go and we convert this UI into an IO.
  • The proximity condition: inside our UI (TeleportHere_UI) we add an interaction named PlayerOnStage that is checking the proximity with the user (HEAD (IO)). The size of the collider has to be of about 2m high to make sure it collides with the one from the user. Our condition will be validated when the proximities are OnEnter. The only action we do here is to deactivate the visuals of the UI.
  • Now all we need is to create an interaction for each Alien dependent on this one. We usually recommend to do this way, to create an interaction without necessarily any direct action but that will actually send a notification to all interactions that are dependent on it, so the condition only needs to be set up once.
  • Inside each Alien we create an interaction dependent on PlayerOnStage that will trigger an animation of the animator (applause, say hi…). When needed we create a second interaction that will be dependent on the first one and will just put the Alien on idle mode after a delay (to stop him from applauding indefinitely).