After working through the initial implementation, testing different interaction scenarios, and refining the system, I'm happy to share the first public release of my Unity Interaction Framework — GP01 V1.
The objective was simple: build a reusable interaction system that allows different game objects to become interactable without tightly coupling their individual behaviours to the core interaction logic.
What does it do?
The framework provides a common interaction structure that can be reused across different objects.
Instead of implementing detection, input handling, visual feedback, and interaction behaviour inside every object, these responsibilities are separated into individual components.
Key Features
- Camera-based Object Detection: Detects interactable objects using a camera-centred raycast.
- Event-driven Target Tracking: Tracks changes in the currently selected interactable object.
- Visual Feedback: Highlights detected objects to communicate target selection.
- HUD Feedback: Displays object information, availability, and interaction prompts.
- Interaction Validation: Checks availability and configuration before executing interactions.
- State-driven Behaviour: Allows individual objects to manage their own interaction states.
Demonstration
The demo scene includes three interactable objects:
- Axe: Demonstrates object collection and availability changes.
- Terminal: Demonstrates state changes and interaction between objects by unlocking the door.
- Door: Demonstrates state-dependent interaction and opening behaviour.
🎥 Showcase Video:
https://youtu.be/_wXCnaBypiM
Some Design Decisions
A few decisions shaped the implementation:
- Used an interface to establish a common contract for interactable objects.
- Separated object detection from interaction execution.
- Used events to communicate target changes instead of tightly coupling components.
- Kept visual feedback separate from individual object behaviours.
- Maintained availability as a separate condition from whether an object can be detected.
These decisions helped keep the framework modular and made it easier to introduce different interactable objects.
Testing and Limitations
The first version was tested with different collider hierarchies, multiple renderers, target changes, interaction availability, configuration validation, and component lifecycle scenarios.
This is a V1 implementation, not a claim that every possible interaction scenario has been solved. Some advanced hierarchy cases and additional edge cases are intentionally left for future iterations.
What's Next?
GP01 V1 establishes the foundation for a reusable interaction framework.
Future improvements can explore more complex interaction scenarios, additional feedback options, and broader hierarchy support.
Project Links
- GitHub Repository: https://github.com/karthickadept/Interaction_Framework
- Showcase Video: https://youtu.be/_wXCnaBypiM
Building this project gave me an opportunity to think beyond making an interaction work and focus on how to make the system reusable, maintainable, and easier for other developers to work with.
Thanks for checking it out!
Top comments (0)