I have many Cesium 3D tileset layers in my Unreal project, which should always be visible (terrain, buildings). However, certain 3D tiles are hidden when the game starts.
Now I would like to make individual tilesets visible with buttons in the Blueprint widget. So that Hidden in Game deactivates when clicking on the button.
How can I control the individual 3DTiles (e.g. floods, trees,…) in the Blueprint widget and then link them to the On clicked button? The 3D tiles cannot be called up with “Get all actors of class”. And SpawnActor is also not accessible in the Blueprint widget.
How scalable do you want this to be? In other words, do you want this to work for a small, unchanging number of tilesets? Or should this work with an arbitrarily large number of tilesets?
My first answer would be to drag the tileset from the World Outliner into the Blueprint, creating a reference to the tileset in the level. Then, assign each tileset its own button, so that it toggles the tileset’s visibility. If this doesn’t work for you, though, let us know more details about your use case so we can give a more informed answer. Thanks!
I can only drag the corresponding tileset from the World Outliner into the Level Blueprint. However, I need the tileset in the Widget Blueprint, where I can also define the buttons. So how do I get a reference to the Cesium 3D tilesets in the Widget Blueprint, not Level Blueprint?
The Play widget is now loaded in the Level Blueprint and the corresponding Cesium 3DTile is linked to the “Tileset HQ100” variable from the Widget Blueprint.
When clicking on the button in the Blueprint widget, the Cesium 3DTile should be hidden. However, the widget should of course remain visible. Unfortunately, I get an access error (Accessed non trying to read property … EventGraph Function … Execute Ubergraph Level Blueprint).
@janine Is there any other method to show/hide Cesium 3D tilesets (HQ100 in my case) with a button during the game? Does this possibly have to be solved via GameInstance? like most users of conventional GIS programs are used to!
Hi @L_N, I’m so sorry for the delayed response. This one slipped off my radar.
I’m not very familiar with the Unreal Widget system, so I’m confused why the Blueprint isn’t working.
In theory it shouldn’t be really hard, you could just toggle the visibility of the tileset like any other actor in the game. But I’m not sure why the widgets are acting differently. Could you share the access error that you’re seeing?
I’m also not sure what GameInstance means here; it would help if you could explain