The relevant variables of the raster overlay (namely the
IonAssetID and the
IonAccessToken) are not accessible via Blueprints, because changing these values at runtime is currently not possible.
(I’m omitting some technical details here, but roughly speaking: Just changing these values would not automatically reload and re-apply the overlay images to the tileset).
These values can only be set when the overlay is created. So for now, the only reasonable way to change the overlay at runtime via blueprints is to 1. destroy the old overlay and 2. add a new overlay with the new
In order to destroy/remove such an overlay, you can use the
Important: This function has to be called on the actor. You can not do this with a “standalone”
DestroyComponent node! If you try that, you’ll receive an error of the form “LogActorComponent:Error: May not destroy component […component name…] owned by […actor…]”.
So you have to drag out a connection from the actor pin (the tileset, in this case), and search for “DestroyComponent” - note that you have to disable the “Context Sensitive” checkbox for this entry to appear:
Afterwards, you can add the new overlay component. (The steps for adding a raster overlay to a tileset via blueprints is described in the post that you already linked to ).
So the following is an example of a blueprint that
- creates the tileset with a certain raster overlay
- destroys the raster overlay after a few seconds
- assigns a new raster overlay (with a different
IonAssetId) after a few seconds: