diff --git a/src/BasicBehaveEngine/decorators/BabylonDecorator.ts b/src/BasicBehaveEngine/decorators/BabylonDecorator.ts index 80fc494..e8da81f 100644 --- a/src/BasicBehaveEngine/decorators/BabylonDecorator.ts +++ b/src/BasicBehaveEngine/decorators/BabylonDecorator.ts @@ -661,9 +661,17 @@ export class BabylonDecorator extends ADecorator { }, (path, value) => { const parts: string[] = path.split("/"); const node = this.world.glTFNodes[Number(parts[2])]; + const shouldBeVisible = value || value === undefined || value === null; + if (node instanceof AbstractMesh) { - (node as AbstractMesh).isVisible = value || value === undefined || value === null; + (node as AbstractMesh).isVisible = shouldBeVisible; + } + if (node._babylonTransformNode) { + (node._babylonTransformNode as AbstractMesh).isVisible = shouldBeVisible; } + node._primitiveBabylonMeshes?.forEach((mesh: AbstractMesh) => { + mesh.isVisible = shouldBeVisible; + }); }, "bool"); this.registerJsonPointer(`/nodes/${maxGltfNode}/extensions/KHR_node_hoverability/hoverable`, (path) => { diff --git a/src/BasicBehaveEngine/nodes/pointer/PointerSet.ts b/src/BasicBehaveEngine/nodes/pointer/PointerSet.ts index 0876ad7..5b061fb 100644 --- a/src/BasicBehaveEngine/nodes/pointer/PointerSet.ts +++ b/src/BasicBehaveEngine/nodes/pointer/PointerSet.ts @@ -54,7 +54,7 @@ export class PointerSet extends BehaveEngineNode { const configValues = this.evaluateAllValues([...this._pointerVals].map(val => val.id)); const requiredValues = this.evaluateAllValues([...this.REQUIRED_VALUES].map(val => val.id)); const populatedPath = this.populatePath(this._pointer, configValues) - const targetValue = requiredValues.val; + const targetValue = requiredValues.value; this.graphEngine.processNodeStarted(this); if (this.graphEngine.isValidJsonPtr(populatedPath)) {