Skip to content

Scripting Basics

Gameplay in HxEngine is written in C# as components attached to entities. This guide introduces the model; the full API reference and samples ship with the engine.

HxEngine uses a UE-style component model (not a pure ECS). You derive from a component base class and override lifecycle methods that the engine calls for you:

OnAttach → OnBeginPlay → OnActivate → OnTick(dt) → OnDeactivate → OnEndPlay → OnDestroy

A scene component additionally carries a transform (local position/rotation/scale and a parent/child hierarchy); a plain component does not.

  • Writing a component and reacting to the lifecycle.
  • Reading input and moving an entity each tick.
  • Querying physics (traces) and handling collision/trigger events.
  • Playing animation, audio events and VFX from code.
  • Referencing sibling components by name and resolving them at spawn time.

SampleGame is the reference: its player controller, movement and grappling hook are all components built on these same pieces.