Skip to content

Reference

This page lists the types and global helpers a script reaches for most often. The full .NET base class library (System.*, System.Math, MathF, LINQ, collections) is also available. See the C# documentation.

Two namespaces cover almost everything.

using LuminaSharp; // EntityScript, Entity, Registry, attributes, Physics, Net, Asset, Task, Debug
using Lumina; // FVector3, FQuat, component types (S*), InputEvent, SCollisionEvent

The math value types live in Lumina and are blittable mirrors of the engine’s own (FVector3 ↔ C++ FVector3).

FVector3 P = new FVector3(0, 2, 0);
float Y = P.Y; // X, Y, Z fields
FVector3 Sum = FVector3.UnitX + P; // operators: + - * /
float D = FVector3.Distance(P, Sum);
FVector3 Dir = (Sum - P).Normalized();
TypeHighlights
FVector2X, Y; Zero, One; Length, Normalized(); Dot, Distance, Lerp
FVector3X, Y, Z; Zero, One, UnitX/Y/Z; Length, Normalized(); Dot, Cross, Distance, Lerp
FVector4X, Y, Z, W; Zero, One (also used for RGBA colors)
FQuatX, Y, Z, W; Identity; AngleAxis(radians, axis); Rotate(v); * composes

Colors are FVector4 (RGBA, components 0–1). Scalar helpers (Sin, Clamp, Lerp, Tau) come from System.MathF.

A lightweight handle to an entity (the C# mirror of entt::entity).

Entity E = World.GetEntityByName("Player");
if (!E.IsNull) { /* ... */ }
uint Raw = E.Id;

Entity.Null is the empty handle; == / != compare by id.

These static classes are usable from anywhere.

ClassMembers
DebugLog(msg), LogWarning(msg), LogError(msg) (writes to the engine log)
AssetLoad<T>(path), LoadAsync<T>(path, callback), Exists(path)
TaskParallelFor, Run, WaitForAll, WorkerCount (see Parallel Work)
ProfilerSample(name) (a using scope), Begin/End, Enabled
Debug.Log($"spawned {E}");
CStaticMesh? Mesh = Asset.Load<CStaticMesh>("/Game/Content/Meshes/Crate");
using (Profiler.Sample("Perception"))
{
RunPerception();
}

Entity-script and system OnUpdate are auto-profiled by type name, so per-script timings show up in the editor’s Gameplay Profiler with no extra code; Profiler.Sample is for breaking a hot method into sub-scopes.

Use these as [Property] field types to get an asset picker in the editor, then resolve them in code. They live in Lumina.

TypeUse
FSoftObjectPathAn untyped reference by path; Exists(), Load<T>(), LoadAsync<T>(cb)
TSoftObjectPtr<T>A typed soft reference; Get(), LoadAsync(cb)
TObjectPtr<T>A typed strong reference holding the resolved object; Value
[Property(Tooltip = "Played on pickup")]
public TSoftObjectPtr<CAudioStream> PickupSound;
public override void OnReady()
{
CAudioStream? Sound = PickupSound.Get();
}

World (and a system’s World) exposes the world beyond your entity. Full detail is in The World API; the surface in brief.

  • Subsystems, World.Registry, World.Physics, World.Navigation, World.UI, World.Messages, World.Net, World.Draw.
  • Entities, SpawnPrefab, DuplicateEntity, DestroyEntity, GetEntityByName, GetEntityByTag, EntityHasTag, GetNumEntities.
  • Transform, GetEntityLocation / SetEntityLocation, SetEntityRotation, TranslateEntity.
  • Hierarchy, SetParent, DetachFromParent, GetParent, GetRootEntity.
  • Time, DeltaTime, ElapsedTime.

Declared in LuminaSharp, applied to script members or classes.

AttributeOnEffect
[Property]field/propertyExposes it in the editor and serializes it. Keys are Category, Tooltip, Name, Min, Max, Units, Color.
[Serialize]field/propertyPersists it without showing it in the inspector.
[Hide]field/propertyNever serialized or shown.
[Alias("OldName")]field/property/classA prior name so saved data survives a rename. Repeatable.
[SkipHotReload]field/property/classResets to default on a C# hot reload instead of carrying the old value.
[RequireComponent]component-typed fieldResolves and caches the component before OnReady (adding it if missing).
[EntitySystem]class (on EntitySystem)Declares a world system’s Stage and Priority.
[UpdatePhase]class (on EntityScript)Runs an entity system’s OnUpdate in EScriptPhase.PrePhysics (default) or PostPhysics.