Studio: Detect Object Type On Tap
StudioThis sample project showcases the ability to tag an object and access it through a click. This allows different objects to be grouped and labeled.
This sample project showcases the ability to tag an object and access it through a click. This allows different objects to be grouped and labeled.
Studio: Detect Object Type
Overview
This sample project showcases the ability to tag an object and access it through a click. This allows different objects to be grouped and labeled by a string.
Controls
Mouse Click / Tap: Interact with objects to apply them to the scene.
Components
Click Detection
Detects when a player clicks or taps on an object in the scene. This component reads the label of the tapped object.
Functionality
Uses raycasting to detect clicks/taps on objects with the component. If an object is clicked and has the required , it triggers a UI popup that tells the user what they clicked.
Label
Defines object tags.
Schema:
entityTag: ecs.string
A string representing the object's tag, used solely for identification purposes.
Functionality
Tracks the of an object for identification.
UIComponent
Injects HTML into the window for pop-up texts and messages.
Functionality
Performs all the styling and construction of messages that appear.
Project Setup
Main Entities/Objects
Inside the folder exists entities that are tappable/clickable objects.
The script is attached to the empty GameManager object.
Customization
Customizing Entity Tags
Modify the field in the inspector.
Technical Details
Asset Formats
All assets are represented as simple 3D models compatible with Three.js (THREE.Object3D).
Input Manager
Mapped Actions:
Click / Tap: Selects an object or combines two elements when dragged together.
Asset Attribution
All assets used in this project are either custom-created or sourced from free-to-use libraries like Sketchfab or Poly Haven.
Additional Notes
This sample project demonstrates a versatile tagging system that can be used for various purposes, such as but not limited to:
Inventory Systems - tagging for items in inventory-based games or applications.
Dynamic Storytelling - tags can be used to trigger narrative events when certain objects are clicked (e.g., unlocking dialogue, revealing hidden clues).
Gamification Features - mini-games where players must find and click on specific tagged objects within a scene (e.g., scavenger hunts).