is it possible to use camera layers (cull_mask) with GridMap?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dydokamil

What I’m trying to accomplish:

  • I want players to be able to see nodes MeshInstance1, MeshInstance2, and GridMap1 when they enter the default mode - A.
  • In mode B some nodes should disappear - only MeshInstance2 and GridMap1 should be visible

I tried doing it with Camera’s cull_mask layers:

  • MeshInstance1 is visible in layer 1
  • MeshInstance2 is visible in layer 1 and layer 2

Now the only problem is with GridMap. As soon as I disable Camera’s first layer the GridMap disappears. GridMap is only visible in the first layer.

Is it possible to solve without using cull_mask?

In my MeshLibrary there’s only one tile which MeshInstance’s cull_mask is set to true (enabled) for all layers.

:bust_in_silhouette: Reply From: jamie-pate

It looks like grid_map.cpp never calls VisualServerScene::instance_set_layer_mask() which means all the multimeshinstances that a gridmap adds to the scene will always have layer_mask == 1 as per the constructor for InstanceBase() in rasterizer.h

This means that you can A layer for gridmaps, but it has to be layer 1 T_T

I’ve created an issue :smiley: