Emotion examples
Six complete scenarios covering hazard overrides, locked expressions, distress branching, analytics logging, no-code UI wiring, and Editor authoring.
Scenario 1: Dynamic hazard response
Profile settings
Output binding
Runtime script
using Convai.Modules.Emotion.Components;
using UnityEngine;
public sealed class HazardZoneTrigger : MonoBehaviour
{
[SerializeField] private ConvaiEmotionController instructorEmotion;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Trainee"))
instructorEmotion.SetEmotionOverride("fear", 0.9f);
}
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Trainee"))
instructorEmotion.ClearEmotionOverride();
}
}Scenario 2: Locked welcome expression
Runtime script
Scenario 3: Emotion-aware branch logic
Runtime script
Scenario 4: Session analytics logging
Runtime script
Scenario 5: No-code UI display
Scenario 6: Previewing expressions in the Editor
Next steps
Emotion profileEmotion scripting APITroubleshoot emotionLast updated
Was this helpful?