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
Tutorials2 min read

Tutorial: first motion

On this page
On this pageTween on an entity fieldWave / helpersHUD motionVerifyNext Back to top

Motion Kit (hi.motion, hi.Tween, hi.Spring, …) animates values you own — entity fields, subsystem HUD state, editor chrome. Do not hang timelines on UiContext.

Deep reference: Motion Kit. Sample: disco_light_data.zig (disco_light archetype).

Tween on an entity field

Use FadeLight as the .data of a defineComponent that requires hi.ComponentLight, then include both components in your actor. The methods below are component lifecycle hooks.

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

const FadeLight = struct {
    intensity: f32 = 2.0,
    fade: hi.Tween = .{},

    pub const metadata = .{
        .properties = .{
            .intensity = hi.UserDataPropertyOptions{ .label = "Intensity", .min = 0 },
            .fade = hi.UserDataPropertyOptions{ .transient = true },
        },
    };

    pub fn start(self: *@This(), actor: hi.ActorContext) void {
        self.fade = hi.Tween.init(0.0, self.intensity, 1.5, .ease_out_cubic);
        hi.render().setLight(actor.id, .{ .intensity = 0.0 });
    }

    pub fn update(self: *@This(), actor: hi.ActorContext, ctx: *const hi.TickContext) void {
        hi.render().setLight(actor.id, .{ .intensity = self.fade.update(ctx.dt) });
    }
};

Wave / helpers

zig
const bob = hi.motion.wave(ctx.total_time * bob_speed + phase) * amplitude;
hi.world().setPosition(id, .{ x, base_y + bob, z });

Respect reduce_motion when driving UI opacity/shift: use hi.motion.resolve (see Motion Kit + accessibility prefs).

HUD motion

Store Tween / Spring on GameSubsystem (or a scene HUD entity), sample into widget styles each onTick / update. Retained editor chrome uses opacity / shift on WidgetStyle plus overlay_motion.zig — same value layer, different host.

Verify

  1. Play a disco_light in physics_playground.json — lights fade in and orbit.
  2. Change intensity in the inspector — sample onChanged restarts a tween.
  3. Enable Reduce motion in editor settings — UI transitions snap; gameplay waves still run unless you gate them yourself.

Next

  • First user_data
  • First UI
PreviousTutorial: first runtime spawnNext Tutorial: first skeletal animation

Documentation follows the current engine checkout.

Snapshot 86f12d68Source docs/tutorials/first-motion.md
On this pageTween on an entity fieldWave / helpersHUD motionVerifyNext Back to top