ReferenceVerse
Implement Interface
implement interface
Updated Compile verifiedExamples verified on the live UEFN compiler
One touch and the sunken statue glows, but a kelp chest could open with the exact same line of code.
An interface defines a strict contract, so any class that implements it guarantees it has the methods your game logic expects.
We declare the interface, implement it in our statue class by overriding the method, and then call it through the interface type.
Reach for interfaces when you want many different classes to share one reliable shape, keeping your puzzle logic clean and swappable.
activatable := interface():
Activate() : void
statue := class(activatable):
Activate<override>() : void = Print("Activated!")
relic_demo := class(creative_device):
OnBegin<override>()<suspends>:void =
Relic : activatable = statue{}
Relic.Activate()
Build your own lesson with implement-interface
Generate a personalized, compile-checked lesson grounded in this exact reference.
Build a lesson →