Environment Showcase
This room showcases how Inworld characters can be set up to respond to events and actions occurring in their environment in Unity.
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.
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.
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.
Interacting with the Toy Rocket causes it to fly into the air and fall off the platform.
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"
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.
For more information on utilizing Intents, Parameters, and/or Character Mutations please see the corresponding links:
- Intents: Concept Definitions
- Parameters: Customizable parameters changing action in runtime
- Character Mutations: Character Mutations