Search Knowledge Base by Keyword
This demo shows how to create dependencies between interactions.
What we want to achieve:
The user teleports into an elevator, enters a specific code to go up a tower.
We assume assets are already in the scene. Each button of the panel is an interactive object, each light of each number of the code is also an IO, the door of the elevator and of course the elevator itself are IOs.
- We put a UI on the floor to indicate to the user where to teleport. The door closes when the user is inside the elevator. The interaction for this to happen is set up with a proximity condition between the Elevator_Door (IO) and the user (Head (IO)). The action is a mecanim animation that was done previously. Make sure the Proximity collider of the Elevator_Door (IO) is big enough to detect your user.
- Buttons of numbers are all interactive objects with Touch enabled. The interaction inside has the touch condition with BOTH hands and an audio as action, the interaction reloads infinitely as we want this to happen every time. Make sure the Hand Hover collider has the size of the button as they are close to each other and we want the user to be precise when touching them.
- The elements that will have the dependencies and will actually make sure the code is written properly are the LED s (lights for each number of the code) here placed over the numbers panel.The interactions of the lights are checking if the corresponding button is being touched (touch condition) and launch an animation of the light being turned on. The code being 4286 what we need to make sure is that the interaction of LED 2 is dependent on the one of LED 4, the one in LED 8 dependent on the one on LED 2 and so on. And interactions are dependent on the others in their Triggered state.
- The elevator: once the code has been entered properly, which means that the interaction on LED 6 has been triggered, we need the elevator to go up. For this we have a custom action that is parentings the camera (user) to the moving platform which has an animation going up. The interaction is then set up like this:
Dependencies: Click_Button_6/no other condition/Actions: animation TriggerPlatformUp and custom Gaze_Trigger Platform with the Camera (IO) as the Object To Parent.
- Other interactions are set with audio feedbacks when the user enters the right code and when he goes up.