diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index 26cddfd6..2c059935 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -5961,6 +5961,16 @@ export class RuntimeHost { return; } + if ( + distanceBetweenPoints( + this.currentPlayerControllerTelemetry.eyePosition, + activeTarget.center + ) > TARGETING_ACTIVE_TARGET_RELEASE_DISTANCE + ) { + this.retargetOrClearActiveRuntimeTarget(); + return; + } + if (this.isRuntimeTargetCameraVisible(activeTarget)) { this.activeRuntimeTargetOcclusionSeconds = 0; } else { @@ -5974,16 +5984,6 @@ export class RuntimeHost { return; } } - - if ( - distanceBetweenPoints( - this.currentPlayerControllerTelemetry.eyePosition, - activeTarget.center - ) > TARGETING_ACTIVE_TARGET_RELEASE_DISTANCE - ) { - this.retargetOrClearActiveRuntimeTarget(); - return; - } } private updateRuntimeTargetingInputState() {