Skip to main content

Environment Showcase

This room showcases how Inworld characters can be set up to respond to events and actions occurring in their environment in Unity.

Playground Environment Room

Interactable Items

The Interactable Items showcase is an example of how you can have an Inworld character react to the player interacting with objects in a scene.

This showcase utilizes Intents, Parameters and Character Mutations.

Interactable Items Showcase

Before you can interact with the items in the showcase you must first enable the interactable goals by greeting Mr. Toyman.

intents:
- name: "greeting"
training_phrases:
- "hi"
- "hello"
- "what's up"
- "yo"

goals:
- name: "greeting"
enabled_by_default: true
repeatable: false
activation:
intent: "greeting"
motivation: "player says hello"
actions:
- instruction: "Ask the player which item they are interested in"
send_trigger: enable_interactables
character_changes:
set_emotion: INTEREST
enable_goals:
- "item_interacted"
- "doll_interacted"
- "angry_interacted"

Once you have greeted Mr. Toyman you can interact with the Toy Rocket or Innequin Miniature by hovering over the object (the reticle turns green) and left-clicking on it.

Interactable Items Innequin Miniature

Interacting with the Innequin Miniature changes its skin and triggers the item_interacted goal.

goals:
- name: "item_interacted"
enabled_by_default: false
repeatable: true
activation:
trigger: "item_interacted"
actions:
- instruction: "Acknowledge {player} {{p.action}} the {{p.item}} and tell them something about that {{p.item}}."

This object has the Material Change Interactable component attached to it which defines the Action and Item parameters in the item_interacted trigger sent from the client.

Interactable Items Innequin Miniature Inspector

Interacting with the Toy Rocket causes it to fly into the air and fall off the platform.

Interactable Items Toy Rocket

This triggers the angry_interacted goal which causes Mr. Toyman to get angry at the player.

goals:
- name: "angry_interacted"
enabled_by_default: false
repeatable: false
activation:
trigger: "angry_interacted"
actions:
- instruction: "React to {player} for {{p.action}} the {{p.item}} worth {{p.price}} dollars."
character_changes:
set_emotion: ANGER
set_custom_dialogue_style:
set_adjectives:
- "annoyed"
- "1 sentence response"

Interactable Items Toy Rocket

The Toy Rocket object has the Apply Force Interactable component attached to it which defines the action, item and cost parameters in the angry_interacted trigger sent from the client.

Interactable Items Toy Rocket Inspector

For more information on utilizing Intents, Parameters, and/or Character Mutations please see the corresponding links: