Using Cesium for Unreal in Unreal Engine 5

Hi everyone!

For Unreal Engine 4.26 and 4.27, the easiest way to install Cesium for Unreal is from the Epic Marketplace. Unfortunately it’s not currently possible to install the plugin for Unreal Engine 5 in the same way. It may be a few days or longer before the plugin is available on the Marketplace, because Epic likely has a significant backlog with everyone submitting their UE5 plugins for inclusion all at once.

In the meantime, we provide pre-built binaries for UE5 on our GitHub releases page:

Installing the plugin from GitHub is easy:

  1. Download the appropriate ZIP file from the “Assets” section on the release page (link above). For example, as of this writing you would download CesiumForUnreal-500-v1.12.1-ue5.zip.
  2. Extract the ZIP file to your Unreal Engine installation’s Engine/Plugins directory. For Windows and UE5, this will usually be C:\Program Files\Epic Games\UE_5.0\Engine\Plugins. You can choose to extract to a subdirectory, such as GitHub or ManuallyInstalled, to keep this manually-installed plugin separate from the standard Engine plugins.

That’s it!

Known issues with Cesium for Unreal and UE5 are being tracked here.

The above will work as long as the plugin package that you download and install is built for the exact version of Unreal Engine that you’re using. If you’re using a later version of Unreal Engine 5, and we haven’t yet released the plugin for that version, the above unfortunately will not work. Unreal Engine will complain that the plugin is for a different Engine version, and refuse to load it.

You can fix this by installing the plugin into your project instead of installing it as an Engine plugin. This works because Unreal Engine builds project plugins as part of the project itself. As long as the plugin compiles with the new version of Unreal Engine, all is well. Here’s how:

  1. Building Cesium for Unreal or any C++ Unreal Engine project requires Visual Studio 2019, so install that if you haven’t already.
  2. Convert your project to a C++ project, if it isn’t one already. The easiest way to do this is by adding a C++ class to it.
    a. In the Editor, go to Tools → New C++ Class.
    b. Choose “None” as the parent class, and click Next.
    c. Give your class a name, or leave the default (MyClass).
    d. Click Create Class.
    e. When prompted to edit the code now, click Yes.
  3. Close the Editor and Visual Studio 2019.
  4. Unzip the Cesium for Unreal plugin release package to a directory called Plugins under your project’s root directory.
  5. In Windows Explorer, right-click on your project’s .uproject file and choose “Generate Visual Studio project files”.
  6. Open the generated .sln file in your project’s root directory in Visual Studio 2019.
  7. In Visual Studio, select Debug → Start Without Debugging. Your project and the plugin will compile, and then the Editor will launch.

If you get compiler errors at step 7, it probably means that changes in Unreal Engine will require (probably minor) changes to the plugin. Let us know!

We will aim to release a new plugin version soon after each new UE5 release, but the above procedure should get you up and running if you want to try it sooner!

Kevin

Updated 2022-04-06: Modified the text to reflect today’s release of the final version of Unreal Engine 5.0.

2 Likes

I am trying to get this step to work for Unreal 5.1- I get to step 7 and it says that it cannot compile in that version of Visual Studio- will this work in Visual Studio 2022?

Hi @M_T,

These instructions are a bit old. The best instructions for compilling the plugin for UE5 yourself are found here:

We haven’t tried UE 5.1 yet, though, so can’t promise it will work. Both Visual Studio 2019 and Visual Studio 2022 should be fine, but in 5.0, at least, VS2019 is more standard and reliable (not sure about UE 5.1).

If you still have trouble with the instructions above, please post your log and we might be able to help.

Kevin

Correct me if I’m wrong, but since I’m trying to get Cesium into a “non standard” release, and want to package it because of that, won’t I want to use Visual Studio 2017? Or am I misunderstanding what is being said in the GitHub?


:grimacing: I’m getting some fails here

C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\CesiumRuntime.Build.cs(181,13): warning CS0618: 'ReadOnlyTargetRules.bCompilePhysX' is obsolete: 'Deprecated in UE5.1 - No longer used as Chaos is always enabled.'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\CesiumRuntime.Build.cs(181,38): warning CS0618: 'ReadOnlyTargetRules.bUseChaos' is obsolete: 'Deprecated in UE5.1 - No longer used as Chaos is always enabled.'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\CesiumRuntime.Build.cs(181,13): warning CS0618: 'ReadOnlyTargetRules.bCompilePhysX' is obsolete: 'Deprecated in UE5.1 - No longer used as Chaos is always enabled.'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\CesiumRuntime.Build.cs(181,38): warning CS0618: 'ReadOnlyTargetRules.bUseChaos' is obsolete: 'Deprecated in UE5.1 - No longer used as Chaos is always enabled.'

[62/354] Compile Module.CesiumEditor.cpp
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumEditor\Private\CesiumPanel.h(5): fatal error C1083: Cannot open include file: 'Dialogs/CustomDialog.h': No such file or directory

[68/354] Compile Module.CesiumRuntime.gen.2_of_4.cpp
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\CesiumGltfComponent.h(25): error C4668: 'PHYSICS_INTERFACE_PHYSX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'

[75/354] Compile Module.CesiumRuntime.cpp
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\CesiumGltfComponent.h(25): error C4668: 'PHYSICS_INTERFACE_PHYSX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\LoadGltfResult.h(23): error C4668: 'PHYSICS_INTERFACE_PHYSX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\LoadGltfResult.h(50): error C4668: 'PHYSICS_INTERFACE_PHYSX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\CreateGltfOptions.h(11): error C4668: 'PHYSICS_INTERFACE_PHYSX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\CreateGltfOptions.h(22): error C4668: 'PHYSICS_INTERFACE_PHYSX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\Packages\CesiumForUnreal\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\Cesium3DTileset.cpp(52): fatal error C1083: Cannot open include file: 'IPhysXCookingModule.h': No such file or directory

BUILD FAILED

For UE4, yes, you’ll want to use VS2017 to package. For UE5, you should use VS2019.

Looks like the code will need some (hopefully minor) changes to work with UE5.1. I don’t know offhand exactly what needs to change, but I’d suggest taking a look at the 5.1 preview’s release notes and trying ti work it out. Let us know how you go.

I am not much of a programmer, but was talking to a programmer friend, they said that the thing thats failing the compilation is that its trying to locate a header file that is missing CustomDialog.h

Does this all check out, and if so, any pointers on how to successfully navigate through?

Sort of. That header used to exist in UE5.0. It (apparently) no longer exists in UE5.1. So you’ll need to figure out what replaced it.

It’s probably (hopefully?) pretty straightforward for someone experienced with C++, but if you’re not familiar with it then you may just need to stick to UE5.0 until 5.1 support is officially available.