diff --git a/src/document/scene-document-validation.ts b/src/document/scene-document-validation.ts index b38601ec..a7c522ca 100644 --- a/src/document/scene-document-validation.ts +++ b/src/document/scene-document-validation.ts @@ -4972,6 +4972,18 @@ function validateNpcEntity( } validateNpcPresence(entity.presence, `${path}.presence`, diagnostics); + + if (typeof entity.targetable !== "boolean") { + diagnostics.push( + createDiagnostic( + "error", + "invalid-npc-targetable", + "NPC targetable must remain a boolean.", + `${path}.targetable` + ) + ); + } + validateNpcModelAssetId(entity, path, document, diagnostics); const seenNpcDialogueIds = new Map(); diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index fe91466b..cb06da0f 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -375,6 +375,7 @@ export interface RuntimeNpc { actorId: string; name?: string; visible: boolean; + targetable: boolean; position: Vec3; yawDegrees: number; scale: Vec3; @@ -663,6 +664,7 @@ export function createRuntimeNpcFromDefinition( actorId: npc.actorId, name: npc.name, visible: npc.visible, + targetable: npc.targetable, position: cloneVec3(npc.position), yawDegrees: npc.yawDegrees, scale: cloneVec3(npc.scale), @@ -1742,6 +1744,7 @@ function buildRuntimeSceneCollections( actorId: entity.actorId, name: entity.name, visible: entity.visible, + targetable: entity.targetable, position: cloneVec3(entity.position), active: true, activeRoutineId: null,