struct
InteractableComponent
- Module
- Game
- Header
#include "Game/Components/InteractableComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
std::string | promptTextKey | |
EInteractionType | interactionType | Default EInteractionType::Use. |
float | range | Default 3.0f. |
float | holdDuration | Default 1.0f. |
float | cooldown | Default 0.0f. |
float | priority | Default 0.0f. |
float | cooldownRemaining | Default 0.0f. |
float | holdProgress | Default 0.0f. |
bool | toggledOn | Default false. |
bool | focused | Default false. |
std::function<void(MObject*)> | onInteract | |
std::function<void(MObject*, bool)> | onFocusChanged |
Public functions
| Returns | Name | Description |
|---|---|---|
void | SetPrompt | |
const std::string& | GetPrompt | |
void | SetRange | |
float | GetRange | |
void | SetEnabled | |
bool | IsEnabled | |
bool | InRange | |
bool | CanInteract | |
bool | TryInteract | heldToCompletion: a finished hold fires WITHOUT re-checking range — focus retention already gated the whole hold, and re-measuring at the final frame let one frame of movement (or physics settling) eat a hold the player legitimately completed. |
Function details
SetPrompt
C++
void SetPrompt(const std::string& p)GetPrompt
C++
const std::string& GetPrompt() constSetRange
C++
void SetRange(float r)GetRange
C++
float GetRange() constSetEnabled
C++
void SetEnabled(bool e)IsEnabled
C++
bool IsEnabled() constInRange
C++
bool InRange(const Vec3& interactorPos, const Vec3& selfPos) constCanInteract
C++
bool CanInteract(const Vec3& interactorPos, const Vec3& selfPos) constTryInteract
C++
bool TryInteract(MObject* interactor, const Vec3& interactorPos, const Vec3& selfPos, bool heldToCompletion = false)heldToCompletion: a finished hold fires WITHOUT re-checking range — focus retention already gated the whole hold, and re-measuring at the final frame let one frame of movement (or physics settling) eat a hold the player legitimately completed.
Generated from Game/Components/InteractableComponent.h via game.json · Nov 5, 2026Version 1.0.0