/**
 * Make something invisible
 * @example
 * ```ts
const cube = getPrefab({ p: [0, -2, 5] });
addInvisibility(cube);
addTo(root, cube);
 * ```
 */
export const addInvisibility = (target, options) => {
    const visibleInPlayOnly = {
        visibleInPlayOnlyType: 'CREATE_ONLY',
    };
    target.visibleInPlayOnly = {
        ...target.visibleInPlayOnly,
        ...visibleInPlayOnly,
    };
    if (target.children) {
        for (const child of target.children) {
            addInvisibility(child, visibleInPlayOnly);
        }
    }
    return target;
};
//# sourceMappingURL=addInvisibility.js.map