Add player movement to runtime scene build

This commit is contained in:
2026-04-11 18:05:08 +02:00
parent 86aa028aeb
commit 3c522bca0f

View File

@@ -537,6 +537,7 @@ function buildRuntimeSceneCollections(document: SceneDocument): RuntimeSceneColl
position: cloneVec3(entity.position), position: cloneVec3(entity.position),
yawDegrees: entity.yawDegrees, yawDegrees: entity.yawDegrees,
navigationMode: entity.navigationMode, navigationMode: entity.navigationMode,
movement: buildRuntimePlayerMovement(entity.movementTemplate),
inputBindings: clonePlayerStartInputBindings(entity.inputBindings), inputBindings: clonePlayerStartInputBindings(entity.inputBindings),
collider: buildRuntimePlayerShape(entity) collider: buildRuntimePlayerShape(entity)
}); });
@@ -717,6 +718,9 @@ export function buildRuntimeSceneFromDocument(document: SceneDocument, options:
const collections = buildRuntimeSceneCollections(document); const collections = buildRuntimeSceneCollections(document);
const interactionLinks = getInteractionLinks(document.interactionLinks).map((link) => cloneInteractionLink(link)); const interactionLinks = getInteractionLinks(document.interactionLinks).map((link) => cloneInteractionLink(link));
const playerCollider = buildRuntimePlayerShape(playerStartEntity); const playerCollider = buildRuntimePlayerShape(playerStartEntity);
const playerMovement = buildRuntimePlayerMovement(
playerStartEntity?.movementTemplate
);
const playerInputBindings = createPlayerStartInputBindings( const playerInputBindings = createPlayerStartInputBindings(
playerStartEntity?.inputBindings playerStartEntity?.inputBindings
); );
@@ -744,6 +748,7 @@ export function buildRuntimeSceneFromDocument(document: SceneDocument, options:
position: cloneVec3(playerStartEntity.position), position: cloneVec3(playerStartEntity.position),
yawDegrees: playerStartEntity.yawDegrees, yawDegrees: playerStartEntity.yawDegrees,
navigationMode, navigationMode,
movement: cloneRuntimePlayerMovement(playerMovement),
inputBindings: clonePlayerStartInputBindings(playerInputBindings), inputBindings: clonePlayerStartInputBindings(playerInputBindings),
collider: playerCollider collider: playerCollider
}; };
@@ -760,6 +765,7 @@ export function buildRuntimeSceneFromDocument(document: SceneDocument, options:
interactionLinks, interactionLinks,
playerStart, playerStart,
playerCollider, playerCollider,
playerMovement,
playerInputBindings, playerInputBindings,
navigationMode, navigationMode,
spawn: resolveRuntimeSpawn( spawn: resolveRuntimeSpawn(