struct

InteractableComponent

Module
Game
Header
#include "Game/Components/InteractableComponent.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

Properties

TypeNameDescription
boolenabledDefault true.
std::stringpromptTextKey
EInteractionTypeinteractionTypeDefault EInteractionType::Use.
floatrangeDefault 3.0f.
floatholdDurationDefault 1.0f.
floatcooldownDefault 0.0f.
floatpriorityDefault 0.0f.
floatcooldownRemainingDefault 0.0f.
floatholdProgressDefault 0.0f.
booltoggledOnDefault false.
boolfocusedDefault false.
std::function<void(MObject*)>onInteract
std::function<void(MObject*, bool)>onFocusChanged

Public functions

ReturnsNameDescription
voidSetPrompt
const std::string&GetPrompt
voidSetRange
floatGetRange
voidSetEnabled
boolIsEnabled
boolInRange
boolCanInteract
boolTryInteractheldToCompletion: 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() const

SetRange

C++
void SetRange(float r)

GetRange

C++
float GetRange() const

SetEnabled

C++
void SetEnabled(bool e)

IsEnabled

C++
bool IsEnabled() const

InRange

C++
bool InRange(const Vec3& interactorPos, const Vec3& selfPos) const

CanInteract

C++
bool CanInteract(const Vec3& interactorPos, const Vec3& selfPos) const

TryInteract

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