New to making games?
Begin with an idea and let Smelty guide you through a small project.
Your first-game guide ↗IRON GRID / C# GAMEPLAY GUIDE
C# is Iron Grid’s primary gameplay scripting language. Start with a Behavior, attach it to an entity, and run it in the native game loop.
Python remains supported for experimentation, learning, and simple behaviors. Visual Scripting compiles to C#. Existing Python projects are not automatically converted.
YOUR NEXT STEP
Begin with an idea and let Smelty guide you through a small project.
Your first-game guide ↗Ask Smelty to explain, create, or troubleshoot inside your project.
Work with Smelty ↗01 / HELLO, GAMEPLAY
Assets/Scripts named RotatingPickup.cs.using IronGrid;public sealed class RotatingPickup : Behavior{ public override void Update(double deltaTime) { // Rotate around the world’s up axis. Transform.Rotate(0, 0, 90 * deltaTime, Space.World); }}02 / MAKE IT RESPOND
In Project Settings → Input, define the MoveHorizontal and MoveVertical axes and assign controls. This simple example moves across the XY plane; Z is up. Use a physics body and the physics APIs when your movement needs collision response.
using IronGrid;
public sealed class PlayerMover : Behavior
{
private const double Speed = 4.0;
public override void Update(double deltaTime)
{
var direction = new Vector3d(
Input.GetAxis("MoveHorizontal"),
Input.GetAxis("MoveVertical"),
0);
if (direction.Magnitude > 1)
direction /= direction.Magnitude;
Transform.Position += direction * Speed * deltaTime;
}
}03 / THE GAME LOOP
Override only the callbacks your Behavior needs. Use FixedUpdate for fixed-step simulation work and Update for per-frame gameplay. Delta time is measured in seconds.
using IronGrid;
public sealed class LifecycleExample : Behavior
{
public override void Awake() { }
public override void OnEnable() { }
public override void Start() { }
public override void FixedUpdate(double deltaTime) { }
public override void Update(double deltaTime) { }
public override void LateUpdate(double deltaTime) { }
public override void OnCollision2D(CollisionEvent2D e) { }
public override void OnTrigger2D(TriggerEvent2D e) { }
public override void OnCollision3D(CollisionEvent3D e) { }
public override void OnTrigger3D(TriggerEvent3D e) { }
public override void OnUiClick(UiEvent e) { }
public override void OnUiValueChanged(UiEvent e) { }
public override void OnUiTextChanged(UiEvent e) { }
public override void OnUiFocusChanged(UiEvent e) { }
public override void OnDisable() { }
public override void OnDestroy() { }
}04 / POSITION, ROTATION, SCALE
Transform is a live object. Assign its properties to update the native entity. Use degree-based Euler angles for authored angles, quaternions for orientations, and Rotate for incremental motion.
Position and Rotation use world space. Their local counterparts are relative to the parent. Iron Grid uses metres, a right-handed Z-up world, and XYZ Euler angles; Vector3d.Up is +Z and Vector3d.Forward is +Y. Rotate and Translate default to Space.Self.
using IronGrid;
public sealed class TransformExample : Behavior
{
public override void Start()
{
// Local properties use the parent's coordinate space.
Transform.LocalPosition = new Vector3d(1, 0, 0);
Transform.LocalEulerAngles = new Vector3d(0, 0, 45);
Transform.LocalScale = Vector3d.One;
// A vector is a value: edit it, then assign it back.
var position = Transform.LocalPosition;
position.Z = 2;
Transform.LocalPosition = position;
}
public override void Update(double deltaTime)
{
// Rotate 90 degrees per second around the world's Z-up axis.
Transform.Rotate(Vector3d.Up, 90 * deltaTime, Space.World);
}
}Vector and quaternion properties return values. To change one component, read the value, edit it, and assign it back, as shown above. To access another entity’s live transform, use Entities.GetTransformComponent(entity). Use LocalRotation or Rotation for quaternion assignments.
05 / KEEP EXPLORING
Browse the C# SDK’s types, methods, and properties in the searchable reference. The engine automatically updates to the latest release when connected to the internet.
Browse the C# API reference →Lifecycle, authored fields, entity identity, and physics or UI callbacks.
Live local and world positions, quaternions, degree angles, and incremental rotation.
Find entities, inspect the active Stage, and work with the native-owned world.
Named input axes and buttons, session timing, and scheduled main-thread callbacks.
Rigid-body operations, casts, overlaps, and copied collision or trigger events.
Connect authored interfaces, sound, entity tags, and interaction filtering to gameplay.
06 / ANOTHER WAY TO AUTHOR
Visual Scripting builds gameplay from event, flow, input, and value nodes. Graph assets compile to C# VisualScriptBehavior types. API coverage is still expanding, so use handwritten C# for behavior outside the current node surface.
WINDOWS ALPHA / PRACTICAL NOTES
Install the Windows editor, create a project, and save your Stage as you work. The installed editor includes its C# compiler and private .NET runtime; you do not need a machine-wide .NET SDK.
Ask Smelty for guidance or help creating gameplay. Connected assistance uses your account’s included allowance; your account shows the remaining balance and next refill. Press Play to check changes, then Stop before editing further.
For export, select Release or Shipping and save your startup and included Stages. Test the exported game separately. Windows may block unsigned games or installers; signing the editor does not sign your game.
The guide follows current development. Check published release notes for the features and limitations in your installed version, and keep project backups during alpha.
Current published release notes ↗Coming in 0.1.13-alpha: the Linux editor, Linux game exports, and Android exports from Windows and Linux. Explore the upcoming release ↗