Getting Started
Follow these steps to integrate the system into your project:
-
01
Import the Package
Import the InteractionSystem.unitypackage into your project.
-
02
Add the Prefab
Drag the PlayerInteraction prefab into your scene as a child of your
First Person Controller.
-
03
Configure Layer Mask
Ensure your interactable objects are on the Interactable layer.
Creating a New Interactable Item
Follow this guide to turn any 3D model into an interactable object in your game.
-
01
Prepare the Object
Select your 3D model in the scene. Ensure it has a Mesh
Renderer.
-
02
Add Physics Components
Add a Box Collider (or Mesh Collider) and a
Rigidbody component.
Rigidbody Settings:
- Mass: 1 (Adjust as needed)
- Collision Detection: Continuous
-
03
Add the Script
Add the InteractableItem script to the object.
-
04
Set the Layer
CRITICAL: Change the object's Layer to
Interactable. If this layer doesn't exist, create it in the Layers
dropdown.
-
05
Configure Item Data
In the InteractableItem component, set the Item
Name and assign a Ghost Prefab if you want
placement previews.
Configuration
Customize the system via the Inspector:
// Example Settings
Interaction Distance: 3.0
Throw Force: 500
Rotation Snap: 90
Select the InteractionManager object to view these settings.
API Reference
Extend the functionality using our public methods:
public void PickUpItem(InteractableItem item) { ... }
public void DropItem() { ... }