Dynamic Controller Feedback not working

Hi guys,

I’ve banged my head against walls whilst trying to create a dynamic force feedback in c++.

I tried the following:

void ABrawlingPlayerController::Tick(float DeltaSeconds)
{
	Super::Tick(DeltaSeconds);
	ProcessForceFeedbackAndHaptics(DeltaSeconds, false);
	PlayDynamicForceFeedback(1.f, -1, true, true, true, true, EDynamicForceFeedbackAction::Update, actionInfo);
}

void ABrawlingPlayerController::ToggleMenu()
{
	PlayDynamicForceFeedback(1.f, -1, true, true, true, true, EDynamicForceFeedbackAction::Start, actionInfo);
}

without any effect. Still I do get things working with blueprints (also with the ClientForceFeedback in blueprints):

http://puu.sh/m4E4E/49f9faf9f3.png

However I want this to be done in C++. I reckon it has something to do with the action info which is at the moment just defined in my .h as

FLatentActionInfo actionInfo;

While doing research I just found this [thread][2] where the guy ended up writing his own method for it. I assume it must be actually pretty easy to get this working, I’m just missing something.

As always thanks for you help

Theo

I have also been trying to implement this via C++ and am having zero success getting anything to happen :frowning:

did anyone figure this out over the holydays? :slight_smile:

bumping this

Hey -

I’ve entered a bug report about the PlayDynamicForceFeedback function not affecting controller rumble when called from code (UE-27456). For now I would stick to using the blueprint node in place of calling the function from code.

Cheers

The FLatentActionInfo struct needs to have a CallbackTarget or the ProcessLatentActions function will never process the Latent action. Ideally it should have a UUID too.

Adding

actionInfo.CallbackTarget = this 

will make it work. You would then call something like

PlayDynamicForceFeedback(1.f, -1, true, true, true, true, EDynamicForceFeedbackAction::Start, actionInfo);

to start the rumble - in either BeginPlay or when the rumbling needs to start.

With the Start call in the update can be used to adjust the rumble.