Skip to content
hikari
RenderingEditorAIToolchainDocumentation
Download

© 2026 Flying Rat Studio.
All rights reserved.

Explore the engineDocumentationContributorsDownloadLicenseBack to top
Documentation / Tutorials
Browse docs
Overview
Tutorials17
OverviewPlay, Edit, and scenesFirst UI documentFirst game projectFirst entityComponent properties and the inspectorFirst mesh and materialFirst physics body and triggerFirst character controllerFirst session servicesFirst UIFirst input actionFirst messagesFirst runtime spawnFirst motionFirst skeletal animationAssets in Play (soft refs and hot reload)Dynamic editor recompile
Guides25
OverviewWorking in the editorDevelopment guideGameplay APIActor and component lifecycleThreads, jobs, events, and routinesGameplay AI tasksGame AI: perception and movement playgroundBrain assetsBrain execution for swarm populationsLocalizationGame cursorsChoosing component storageBuild and packagingProject filePluginsHikari Plugin APIData-driven content, JSON, and pathsScripting with KawaShader authoringChoosing and scaling shadowsTime of dayUser interfaceUI layoutUI widgetsMigration from Unity / Unreal
Systems32
OverviewArchitectureApplication lifecycleFrontends and driversPlatforms and supportSession services and cross-scene stateScenes and gameplayActor communication (hi.actors)Game-facing refsSave / replication wire versionCoordinate space and camera conventionsRenderingRenderer architecture mapFrame governorPipeline compilationSkeletal animationGPU particlesVisual ZonesVolumetric mediaInputAudioPhysicsMotion KitTemporal KitUI documentsAssets and ShinraPrefabsAsset residencyAsset formats (Shinra pipeline)Document schemasUI and editorEditor asset hot reloadEditor Project Selector
Language reference3
OverviewAkari GPU ABIAkari language referenceKawa language reference
Engine overview
Start exploring
  • No matching sections. Try fewer words or another topic.
NavigateEnter Openesc Close
Overview
Tutorials17
OverviewPlay, Edit, and scenesFirst UI documentFirst game projectFirst entityComponent properties and the inspectorFirst mesh and materialFirst physics body and triggerFirst character controllerFirst session servicesFirst UIFirst input actionFirst messagesFirst runtime spawnFirst motionFirst skeletal animationAssets in Play (soft refs and hot reload)Dynamic editor recompile
Guides25
OverviewWorking in the editorDevelopment guideGameplay APIActor and component lifecycleThreads, jobs, events, and routinesGameplay AI tasksGame AI: perception and movement playgroundBrain assetsBrain execution for swarm populationsLocalizationGame cursorsChoosing component storageBuild and packagingProject filePluginsHikari Plugin APIData-driven content, JSON, and pathsScripting with KawaShader authoringChoosing and scaling shadowsTime of dayUser interfaceUI layoutUI widgetsMigration from Unity / Unreal
Systems32
OverviewArchitectureApplication lifecycleFrontends and driversPlatforms and supportSession services and cross-scene stateScenes and gameplayActor communication (hi.actors)Game-facing refsSave / replication wire versionCoordinate space and camera conventionsRenderingRenderer architecture mapFrame governorPipeline compilationSkeletal animationGPU particlesVisual ZonesVolumetric mediaInputAudioPhysicsMotion KitTemporal KitUI documentsAssets and ShinraPrefabsAsset residencyAsset formats (Shinra pipeline)Document schemasUI and editorEditor asset hot reloadEditor Project Selector
Language reference3
OverviewAkari GPU ABIAkari language referenceKawa language reference
Engine overview
Tutorials3 min read

Tutorial: component properties and the inspector

On this page
On this page1. Declare fields + metadata2. Seed from scene JSON3. Verify in the editorNext Back to top

Supported logic-component fields become inspector properties automatically. For the default attachable storage, the scene saves them under components.<component_name>. metadata.properties is optional presentation and policy metadata; use it to rename, constrain, hide, order, or choose a widget for a field. Edit in the inspector in Edit mode; values seed the live actor on Play / scene load.

Deep reference: Scenes and gameplay. Sample: cube_entity.zig (health / max_health + transient current_health).

1. Declare fields + metadata

zig
const hi = @import("hikari_game");

const BeaconLogic = hi.defineComponent(.{
    .name = "beacon_logic",
    .data = struct {
        spin_speed: f32 = 1.0,
        label_color: [3]f32 = .{ 1, 1, 1 },
        /// Not serialized / not shown in the inspector.
        runtime_angle: f32 = 0,

        pub const metadata = .{
            .properties = .{
                .spin_speed = hi.UserDataPropertyOptions{ .label = "Spin Speed", .min = 0, .step = 0.05 },
                .label_color = hi.UserDataPropertyOptions{ .label = "Color", .min = 0, .max = 1, .step = 0.01 },
                .runtime_angle = hi.UserDataPropertyOptions{ .transient = true },
            },
        };

        pub fn onChanged(self: *@This(), actor: hi.ActorContext, property: []const u8) void {
            const id = actor.id;
            _ = .{ self, id, property };
            // React to inspector edits while live (Edit preview / Play).
        }

        pub fn update(self: *@This(), _: hi.ActorContext, ctx: *const hi.TickContext) void {
            self.runtime_angle += self.spin_speed * ctx.dt;
        }
    },
});

pub const BeaconEntity = hi.defineActor(.{
    .archetype = "beacon",
    .components = .{BeaconLogic},
});
OptionEffect
.label, .tooltip, .min, .max, .step, .orderInspector presentation and ordering
.hidden = trueOmitted from the authoring surface; typed gameplay code still owns the field
.transient = trueNot authored in scene JSON; skipped by applyJson
metadata = .{ .runtime_only = true }No editor property schema; scene user_data may still seed JSON-safe fields

Embedded components may use the actor’s root user_data for their authored fields. Use Component storage when deciding between storage policies.

runtime_only means “no inspector sheet”, not “cannot place in a scene” and not “scene cannot seed”. JSON-safe POD fields (bools, numbers, vectors, nested POD structs) still load from user_data; pointer/slice fields and anything marked transient are skipped. Reflection and metadata are compile-time/static declaration work: component instances gain no property bags, maps, allocations, or per-tick reflection.

2. Seed from scene JSON

json
{
  "id": "beacon_01",
  "archetype": "beacon",
  "transform": { "position": [0, 1, 0], "rotation_euler": [0, 0, 0], "scale": [1, 1, 1] },
  "components": {
    "beacon_logic": {
      "spin_speed": 2.5,
      "label_color": [0.2, 0.8, 1.0]
    }
  }
}

Omit keys to keep struct defaults. Multiple actors can share an archetype with different component values (see demo disco_light_*).

3. Verify in the editor

  1. Rebuild, open the scene, select the actor.
  2. Inspector shows Spin Speed / Color; change a value — onChanged runs when live.
  3. Save the scene and confirm components.beacon_logic persisted (non-transient fields only).

Next

  • First motion — tween those fields
  • First mesh and material
PreviousTutorial: first entityNext Tutorial: first mesh and material

Documentation follows the current engine checkout.

Snapshot 86f12d68Source docs/tutorials/first-user-data.md
On this page1. Declare fields + metadata2. Seed from scene JSON3. Verify in the editorNext Back to top