Disabled and Hidden components

Hi!
Documentation states there are Disabled and Hidden components that does such manipulations with entities. But there are no such components under he +new component menu.
I assumed they are build-in (and represented by icons in inspector), but addressing such components through scripts doesn’t achive anything. I am using Cloud Studio.

The + Button is a shortcut for creating an entity with components.

Disabled and Hidden are components you can see them in use in various sample projects. See line 40 on the tap-place.ts script in the World Effects sample project here:

Ah, so these components don’t disable or hide entities on the running application?
I assumed they have the same functions as or control checkbox and visibility (eye) button in the inspector panel of entity.

They do, but they have to be added at runtime. They don’t show up in the component selector.

1 Like

I will try to describe my problem more precisely as i couldn’t figure out how to disable and enable and if it possible in my specific case.

  1. Untill i figured out how to disable/enable doing runtime i use turning on/off visibility of 3d object (gaussian splat) on event
  2. I have 2-3 gaussian splats in my scene. my visibility script solves the problem of perfomance by turning only 1 gaus at a time
  3. But when i am running app with 3 gaus enabled it crashes despite they are all invisible at the start. It doen’t crash if i have only 2 splats enabled.

So can disabled component solve that problem by disabling/enabling splats instead of hiding?
Also i am not sure exact reason scene crashes on loading, maybe it’s because loading all 3 splats at the same time. And therefore could disable/enable at least solve this by loading one at a time (but still using visibility script)?

Gaussian splats in general have a pretty intense resource usage. I would recommend different approaches and see which gives you the result you’re looking for.

Generally my go to approach for something like this would be to have each splat be in it’s own space or use a single splat component and modify the URL of the splat component with a custom component.

1 Like