-
Notifications
You must be signed in to change notification settings - Fork 9
Interaction Prompt
To enable the interaction prompt to show up once the player goes within the interactable range of an entity that is, near the entity, the
DistanceCheckComponent
and the ProximityControllerComponent
work together to make that happen.
The DistanceCheckComponent
class extends the Component
class and takes 2 arguments. The first is distance
, which is of type float, this is essentially how much you want the interactable distance to be for the prompt to show up. The second is label
, which is an instance of the class InteractLabel
.
This is usually initialized with the .addComponent method with the entity that you want the player to interact with. For example: extractor.addComponent(new DistanceCheckComponent(5f, interactLabel));
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files