AF-GRILL / DISForUnrealExample

BSD 2-Clause "Simplified" License
9 stars 4 forks source link

project error #2

Closed MihonZhu closed 2 years ago

MihonZhu commented 2 years ago

When I open the project, an error will be displayed: 'Received status code 401 for asset response https://api.cesium.com/v1/assets/0/endpoint ', how can I solve it?THANKS!

AFRLGrill commented 2 years ago

This error happens when there is an issue with a Cesium Ion access token. In the case of our project, it happens because we leave the Cesium Ion access tokens empty on the Cesium actors in the level and load in the access tokens during runtime from a config file. We do this as it allows the access tokens to still be changed after the project has been built.

The error shouldn't impact your usage of Cesium in the project.

If you want to get rid of the error you can follow the steps under 'Step 4: Connect to Cesium Ion' in the following link: https://cesium.com/learn/unreal/unreal-quickstart/#step-4-connect-to-cesium-ion

This is a short guide that will step you through connecting a Cesium Ion account to Unreal Engine and creating an access token.

Once you have an access token, you'll have to place the token in the 'Cesium World Terrain' and 'Local Cesium World Terrain' actors. It will need placed in the 'Ion Access Token' variable under both the default actor and the attached 'CesiumIonRasterOverlay' component. You may also need to update the 'Ion Asset ID' variable in these actors as well. The World Terrain objects should be '1' and their associated CesiumIonRasterOverlay components should be '2'. You can also update the config file we load from during runtime with your keys. The config file is located inside of the project folder under "\Saved\Config\Windows\Game.ini".