Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Autopilot XRUI Fix #8058

Merged
merged 2 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ export const assessWalkability = (
export const clearWalkPoint = () => {
const markerState = getMutableState(AutopilotMarker)
markerState.walkTarget.set(undefined)
markerState.markerObject.value!.visible = false
if (!markerState.markerObject.value) return
markerState.markerObject.value.visible = false
}
11 changes: 11 additions & 0 deletions packages/engine/src/xrui/systems/XRUISystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import { getMutableState, getState } from '@etherealengine/hyperflux'
import { WebContainer3D, WebLayerManager } from '@etherealengine/xrui'

import { clearWalkPoint } from '../../avatar/functions/autopilotFunctions'
import { Engine } from '../../ecs/classes/Engine'
import { Entity } from '../../ecs/classes/Entity'
import { defineQuery, getComponent, hasComponent, removeQuery } from '../../ecs/functions/ComponentFunctions'
Expand Down Expand Up @@ -81,6 +82,11 @@ const redirectDOMEvent = (evt) => {
if (hit && hit.intersection.object.visible) {
hit.target.dispatchEvent(new evt.constructor(evt.type, evt))
hit.target.focus()
// quick hack to fix autopilot triggering on click until spatialized input is implemented

setTimeout(() => {
clearWalkPoint()
}, 2)
return
}
}
Expand Down Expand Up @@ -130,6 +136,11 @@ const updateClickEventsForController = (controller: PointerObject) => {
if (hit && hit.intersection.object.visible) {
hit.target.dispatchEvent(new PointerEvent('click', { bubbles: true }))
hit.target.focus()
// quick hack to fix autopilot triggering on click until spatialized input is implemented

setTimeout(() => {
clearWalkPoint()
}, 2)
}
}
}
Expand Down