Interact with Game Player


Basis of the basis

Below is the basis used in the game to communicate with players.
InfoZone is located in the "Interactables".
DialogueCanvas is located in the "UIPrefabs".

Passing game information to the player is important to keep the flow smooth. The Game Kit comes with Interactables that include an item called InfoZone. The InfoZone defines the area when Ellen enters. Some action will be performed.

Using dialogue boxes is one way to let the player know what is happening. Therefore, the Game Kit included DialogueCanvas as a UI element. We can use it to give players the information we want them to have.

Now we know we have InfoZone and DialogueCanvas. We use InfoZone to determine when to provide the information, and DialogueCanvas is the method we use to provide the information.

Setting up the InfoZone
In the "Interact On Trigger (Script)", select Layers to "Player".
On Enter, select DialogueCanvas and set the dialogue to active.
The "Runtime Only" selects the DialogueCanvas, and the action selects "DialogueCanvasController.ActiveCanvasWithText(string)
On Exit, select "Runtime Only" to DialogueCanvas and the action selects "DialogueCanvasController.deactiveCanvasWithDelay(float)

To prevent the dialogue from popping up again, select "Runtime Only" to InfoZone, and the action selects gameObject.SetActive.

The 3D Game Kit Demo uses the Localization method. All the messages are stored in a separate file in the same language. This method supports multiple languages but requires a bit of coding to use in my game. Therefore, I leave it for now and implement it in the future.

Leave a comment

Log in with itch.io to leave a comment.