+1 vote

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.

in Engine by (19 points)

1 Answer

0 votes

It looks like gridmap.cpp never calls VisualServerScene::instancesetlayermask() 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

https://github.com/godotengine/godot/blob/3.2/servers/visual/rasterizer.h#L134
https://github.com/godotengine/godot/blob/3.2/modules/gridmap/grid_map.cpp#L535

I've created an issue :D

https://github.com/godotengine/godot/issues/42752

by (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.