From 14a283010e762e356ffe251f278335736019af00 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 11 May 2026 21:57:07 +0200 Subject: [PATCH] Implement NPC target anchor features --- src/app/App.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index e194b485..5d2f948c 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -315,7 +315,10 @@ import { DEFAULT_INTERACTABLE_RADIUS, DEFAULT_NPC_MODEL_ASSET_ID, DEFAULT_NPC_SCALE, + DEFAULT_NPC_TARGET_ANCHOR_MODE, + DEFAULT_NPC_TARGET_ANCHOR_OFFSET, DEFAULT_NPC_YAW_DEGREES, + NPC_TARGET_ANCHOR_MODES, DEFAULT_POINT_LIGHT_COLOR_HEX, DEFAULT_POINT_LIGHT_DISTANCE, DEFAULT_POINT_LIGHT_INTENSITY, @@ -363,6 +366,7 @@ import { createNpcAlwaysPresence, createNpcColliderSettings, createNpcEntity, + createNpcTargetAnchor, createPointLightEntity, inferPlayerStartMovementTemplateKind, createPlayerStartInputBindings, @@ -398,6 +402,7 @@ import { type PlayerStartSystemAction, type PlayerStartMovementTemplate, type PlayerStartNavigationMode, + type NpcTargetAnchorMode, type EntityInstance, type EntityKind } from "../entities/entity-instances"; @@ -944,6 +949,21 @@ function createVec3Draft(vector: Vec3): Vec3Draft { }; } +function formatNpcTargetAnchorMode(mode: NpcTargetAnchorMode): string { + switch (mode) { + case "center": + return "Center"; + case "eyeHeight": + return "Eye Height"; + case "top": + return "Top"; + case "origin": + return "Origin"; + case "custom": + return "Custom Offset"; + } +} + function formatRuntimeDayPhaseLabel( dayPhase: ReturnType["dayPhase"] ): string {