unity-interaction

Implement raycast-based primary and alternate interactions for Unity games.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-interaction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-interaction
Source: https://github.com/MuharremTozan/Ohm-Yura/tree/main/.agents/skills/unity-interaction
Command: npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-interaction

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Provides a generic, raycast-based interaction system for Unity games, enabling consistent interactions across genres without tying logic to a single object type.

Core Features & Use Cases

  • Interface-based IInteractable and IInteractor enable decoupled interaction targets
  • Dual actions: Primary (E) and Alternate (F) interactions
  • Raycast-based target detection with player-facing direction
  • Self-contained, zero external dependencies for quick adoption
  • Use cases include doors, chests, NPCs, crafting stations, and switches across RPG, Simulation, and Platformer games

Quick Start

Add an InteractionController to the player, configure the interactable layer and distance, and implement IInteractable on objects.

Frequently Asked Questions about unity-interaction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up raycast interactions in Unity for multiple game objects?

Raycast interactions in Unity are set up by adding an InteractionController to the player and implementing the IInteractable interface on target objects. This decouples interaction logic, allowing doors, chests, and NPCs to share a consistent detection system.

Can I use this Unity interaction system for both RPG and simulation games?

Yes, this Unity interaction system is designed for RPG, simulation, and platformer games. It provides generic interface-based detection that enables primary and alternate interactions with nearby objects across various genres without tying logic to a specific object type.

Does the Unity raycast interaction system require external input packages?

No, the Unity raycast interaction system has zero external dependencies. It is a self-contained setup that includes interface definitions, a DetectionController, and input mappings for primary and alternate interactions without requiring additional packages.

How do I implement alternate and primary interactions for detected objects?

Alternate and primary interactions are implemented using the IInteractable interface on target objects. The system maps dual actions to primary and alternate inputs, allowing players to interact with nearby detected objects like crafting stations or switches using separate keys.

What is the best way to handle player input for object detection in Unity?

Handling player input for object detection in Unity is best managed through a raycast-driven DetectionController. It checks the player-facing direction to identify IInteractable targets, enabling consistent primary and alternate actions without hardcoding logic for each object type.