Unity prototype · 2026

Unity Interactive Companion

Following, guiding and waiting in a shared virtual space.

Project overview

A Unity prototype exploring how a virtual companion greets, follows and guides a user through a shared space. It combines obstacle-aware navigation, animated greetings and distance-based waiting, with controls for pausing, resuming and changing plans.

I designed the interaction flow and implemented the C# state logic, user controls and interface feedback, integrating NavMesh navigation with character locomotion and greeting animation.

Demonstration

Code and setup instructions on GitHub ↗

01 / Interaction design

Keeping the user part of the journey

Greet, then approach

The companion checks distance and whether a wall blocks its view. It turns toward the user and waves before approaching. Navigation routes around obstacles, while a retreat response maintains space when the user moves too close.

Offer a choice

Accepting the invitation starts the route to the meeting point. Declining keeps the companion following the user. “Wait a moment” interrupts the current activity, turns the character toward the user and reopens those choices.

The companion stops and turns toward the user, displaying I'll wait for you.
Wait and look back. Beyond 3.5 metres, the companion stops and turns toward the user. It resumes when the user returns within 2.5 metres.
The companion faces the user beside the meeting point, with the option to reconsider still available.
Arrive and remain available. At the meeting point, the character faces the user. The call-back control remains available to change plans.

02 / Implementation

Connecting movement to interaction

A C# state controller coordinates following, turning, choices, guiding and arrival. NavMesh handles the route, and the Animator uses navigation velocity to transition between standing and locomotion.

Unity Scene view with the blue baked NavMesh surrounding the wall obstacle, character and meeting point.
Scene setup in Unity. The blue NavMesh defines walkable space around the wall.
Interaction states
CompanionApproach.cs manages the greeting, invitations, navigation and distance-based waiting.
Character animation
CompanionLocomotion.cs passes movement speed to the Animator; the greeting triggers a wave.
User controls
UserTargetMovement.cs moves the user sphere with collision blocking. WASD moves; Q pauses and E resumes the interaction.

Prototype and interaction integration: Shirui Fu. Character and locomotion animations: Unity Starter Assets. Greeting animation: Mixamo.