A MQTT client with blueprint support for Unreal Engine 4, based on Mosquitto.
Because this has not been developed as a plugin, the installation process is slightly very cumbersome. Only Windows x64 is supported so far.
- Make sure your project is set-up for C++. If it's not already the case, add a simple C++ Actor in Unreal that you could remove later.
- Add the
ThirdPartyfolder to the UnrealProject. - Edit your project's build file, named
YourProjectName.Build.csin theSource/YourProjectNamefolder. The changes are based on theSource/ProjectName/ProjectName.Build.csfile.- Add the
using System.IO; - Add the two new methods
ThirdPartyPathandLoadThirdPartyDLL. - Add the two
LoadThirdPartyDLLat the end of the constructor.
- Add the
- Add the source files in the
Source/ProjectName/PrivateandSource/ProjectName/Publicfolders to your respectiveSource/YourProjectName/PrivateandSource/YourProjectName/Publicfolders. - In these files, replace all occurences of
ProjectNamebyYourProjectNameandPROJECTNAME_APIbyYOURPROJECTNAME_API. - Finally, add the
mosquitto.dllandmosquittopp.dllin theBinaries/Win64folder. You can find these two DLLs in theThirdPartysubfolders, but you will have to to remove.x64from their pathname. - Right-click on
YourProject.uprojectfile, and selectGenerate Visual Studio Project files. - Open
YourProject.slnand compile everything. - (Re)Start the Unreal Engine Editor.
To use the MQTT client, the simplest method is to create a blueprint child class from it.
- Find the C++ Unreal Mosquitto class in the content browser.
- Right click and select
Create Blueprint class based on UnrealMosquitto.
This new child class has access to the events in its event graph. You can also configure the client in the MQTT section in the details panel of the root element. The router can dispatch executions flows based on MQTT topics.
