Plugin in Blueprints


Since the engine does not have any direct support for joysticks, I wrote a plugin that can access joysticks via SDL library. As usual, the plugin is inherited from IModuleInterface and I have an object inherited from UObject. I want to access the functions of the plugin, but I can’t. However, I can add the object inherited from UObject in the blueprints and call its functions. How can I enable plugin functions in blueprints ?


How about creating a blueprint function library (BFL)? Functions that you put in BFL are usually static and can appear as nodes in any BP. It usually goes like this:


#pragma once
#include "Engine.h"
#include "TestBPLibrary.generated.h"

class UTestBPLibrary : public UBlueprintFunctionLibrary

	UFUNCTION(BlueprintCallable, Category = "Testing")
	static float TestSampleFunction(float Param);


#include "TestBPLibrary.h"

UTestBPLibrary::UTestBPLibrary(const FObjectInitializer& ObjectInitializer) 
: Super(ObjectInitializer)


float UTestBPLibrary::TestSampleFunction(float Param)
	return -1;

Hope this helps

Well it definitely helps. Looks like the best thing to do is move the methods I declared in IModuleInterface to UBlueprintFunctionLibrary.

Thank you very much.

1 Like