View as Markdown

Installing Hiro in Unreal Engine

The Unreal client is available from Heroic Labs. Contact us to request access.

Make sure to install the Nakama plugin before continuing if you haven’t done so already.

The Hiro plugin ships as a zip containing all source code and dependencies required in the client code.

After downloading the file, add the contents to your Unreal project’s Plugins folder:

  1. Open your Unreal project
  2. Navigate to the Plugins folder, if one doesn’t exist, create it
  3. Extract the contents of the zip into the Plugins folder
    • Optionally, place the Hiro files into your Unreal Engine Plugins folder to use the plugin across multiple projects. For example:
Project
├──...
└──Plugins
   ├──...
   ├──Nakama
   │   ├──...
   │   └──Nakama.uplugin // ensure you have also installed Nakama
   └──Hiro
       ├──...
       └──Hiro.uplugin

Each release ships two builds of the Hiro Unreal plugin. Which one you need depends on the Nakama Unreal SDK your project uses:

Nakama Unreal SDKHiro plugin
v3HiroUnreal-<version>.zip
v2.xHiroUnreal-v2-<version>.zip

Both extract to a folder named Hiro, so check which file you downloaded before you extract it.

Remember to add the modules to the dependencies under your project’s Build.cs file. For example:

1
PrivateDependencyModuleNames.AddRange(new string[] { "Nakama", "HiroUnreal" });

The Nakama module name depends on which build you installed. Use Nakama with the v3 build, and NakamaUnreal with the v2 build.

  1. Restart Unreal Engine
  2. Go to Edit -> Plugins and make sure that both the Nakama and Hiro plugins are enabled.
Unreal Engine Plugins panel showing both the Nakama and Hiro plugins listed with their enabled checkboxes ticked
Enable the plugins in Unreal Engine

Initializing the HiroClient #

To use Hiro in Unreal, you first need to create a NakamaClient. After that, you can initialize Hiro and create a HiroClient by passing in the previously created NakamaClient.

1
2
3
4
5
#include "NakamaClient.h"
#include "HiroClient.h"

UNakamaClient* NakamaClient = UNakamaClient::CreateDefaultClient(TEXT("defaultkey"), TEXT("localhost"), 7350, false, true);
UHiroClient* HiroClient = UHiroClient::CreateDefaultClient(NakamaClient);