Skip to content

Commit 0091a6f

Browse files
committed
fix(soba): track parent nonObjects before creating decal
1 parent 92af0e9 commit 0091a6f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libs/soba/misc/src/lib/decal.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ export class NgtsDecal {
9696

9797
if (!parent) return;
9898

99+
const parentLocalState = getLocalState(parent);
100+
if (!parentLocalState) return;
101+
102+
// track parent's children
103+
const parentNonObjects = parentLocalState.nonObjects();
104+
if (!parentNonObjects || !parentNonObjects.length) return;
105+
99106
const [position, rotation, scale] = [this.position(), this.rotation(), this.scale()];
100107
const state = {
101108
position: new Vector3(),

0 commit comments

Comments
 (0)