File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,13 @@ export function interactableSystem(world: HubsWorld) {
29
29
// If it has media frame collision mask, it needs to have content bounds
30
30
if ( hasMesh && Rigidbody . collisionFilterMask [ eid ] & COLLISION_LAYERS . MEDIA_FRAMES ) {
31
31
const box = getBox ( obj , obj ) ;
32
- box . getSize ( tmpVector ) ;
33
- addComponent ( world , MediaContentBounds , eid ) ;
34
- MediaContentBounds . bounds [ eid ] . set ( tmpVector . toArray ( ) ) ;
32
+ if ( ! box . isEmpty ( ) ) {
33
+ box . getSize ( tmpVector ) ;
34
+ addComponent ( world , MediaContentBounds , eid ) ;
35
+ MediaContentBounds . bounds [ eid ] . set ( tmpVector . toArray ( ) ) ;
36
+ } else {
37
+ console . error ( `Couldn't create content bounds for entity ${ eid } . It seems to be empty or have negative scale.` ) ;
38
+ }
35
39
}
36
40
} ) ;
37
41
}
You can’t perform that action at this time.
0 commit comments