Download Download Support FPE

How to Add Custom Interactions to FPE Objects in Godot

How to Add Custom Interactions to FPE Objects in Godot

FPE can carry the repeated identity and setup from Blender; your game can add the unique interaction. Doors, buttons, notes, and pickups still benefit from one small contract: can the player interact, what prompt appears, and what happens next?

Use Blender commands before writing code. FPE triggers already support Enter, Exit, Interaction, Deposit, Withdraw, Hold, Release, Holdable Items Available/Unavailable, and Hold Zone Interaction. Scene Event commands can dispatch events, play or stop animations, control speakers and cameras, load levels or sub-scenes, start conversations, pause activities, delete groups, and restore player controls. Add custom Godot code only when your mechanic goes beyond that catalog.
FPE Trigger Events panel showing player interaction and a named event
Start by checking the interaction FPE can already author. Add GDScript only when the object needs behavior beyond these built-in trigger choices.

Define a tiny interaction contract

An interactable should answer whether it is currently usable, provide prompt text, and perform one action. Keep player input out of the door script; the player finds a target and asks it to interact.

class_name Interactable
extends Node3D

@export var prompt := "Use"

func can_interact(_actor: Node) -> bool:
    return true

func interact(_actor: Node) -> void:
    pass
Invisible trigger volume placed around an interactive Blender object
A proximity interaction begins as a deliberately shaped trigger volume around the usable part of the prop.

Three useful detection patterns

Proximity

An Area3D tracks nearby candidates. This is forgiving and works well for cozy games, controller input, and objects that should announce themselves. Pick the closest or highest-priority candidate when several overlap.

View-centered ray cast

A RayCast3D from the camera gives precise first-person selection. Configure it to collide with the layers used by interactive physics bodies or areas, and walk from the collider to its interaction component.

Direct pointer input

Godot can deliver input events to a CollisionObject3D when object picking is enabled. This is a good fit for point-and-click scenes, but less convenient for keyboard or controller navigation.

Godot editor with the FoldedPaperEngine node in the stable Stage scene
Attach custom components in the stable Godot scene or instantiate them around imported content; do not hand-edit generated imports.

Step-by-step implementation

  1. Create the interaction contract and implement it on one simple switch.
  2. Add one detector to the player and keep its current target in a single property.
  3. Show prompt text from that current target.
  4. Map a project input action named use and call the target only on the pressed edge.
  5. Make state changes idempotent: an already-open door should not start five overlapping animations.

Common mistakes

  • Putting bespoke ray-cast logic in every object instead of one player-side detector.
  • Assuming the ray collider is the scripted root; imported meshes often have collider children.
  • Leaving prompts visible after the target is freed or disabled.
  • Hard-coding key names instead of using an Input Map action.

Godot reference: Ray casting