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

Commit

Permalink
fix old collider component reactivity (#10281)
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField authored May 31, 2024
1 parent f6a75c3 commit 392ace8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/engine/src/scene/components/OldColliderComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import {
} from '@etherealengine/spatial/src/physics/types/PhysicsTypes'
import { GroupComponent } from '@etherealengine/spatial/src/renderer/components/GroupComponent'
import { MeshComponent } from '@etherealengine/spatial/src/renderer/components/MeshComponent'
import { iterateEntityNode } from '@etherealengine/spatial/src/transform/components/EntityTree'
import { iterateEntityNode, useTreeQuery } from '@etherealengine/spatial/src/transform/components/EntityTree'
import { TransformComponent } from '@etherealengine/spatial/src/transform/components/TransformComponent'
import {
computeTransformMatrix,
Expand Down Expand Up @@ -162,6 +162,7 @@ export const OldColliderComponent = defineComponent({
const colliderComponent = useComponent(entity, OldColliderComponent)
const isLoadedFromGLTF = useOptionalComponent(entity, GLTFLoadedComponent)
const groupComponent = useOptionalComponent(entity, GroupComponent)
const tree = useTreeQuery(entity)

useLayoutEffect(() => {
setComponent(entity, InputComponent)
Expand Down Expand Up @@ -259,7 +260,7 @@ export const OldColliderComponent = defineComponent({
removeComponent(entity, TriggerComponent)
}
}
}, [isLoadedFromGLTF, colliderComponent, transformComponent, groupComponent?.length])
}, [isLoadedFromGLTF, colliderComponent, transformComponent, groupComponent?.length, tree])

return null
}
Expand Down

0 comments on commit 392ace8

Please sign in to comment.