Hey
I’m hoping somebody can help me out here. I’m not having a lot of luck making either a Xbox360 or Xbox1 controller vibrate (attached to a Windows PC). Either pad can be used to control the game just fine.
I’ve tried two methods, neither to success, both in Debug and Development builds. Using Unreal Editor v4.5.1. My code is hit and stepping through I can see no obvious problems with my calls (no early outs in engine code). I have noticed that my breakpoint at the start of FActiveForceFeedbackEffect::Update() is not being hit, implying I’m not activating the effects properly.
Using APlayerController::PlayDynamicForceFeedback()
FLatentActionInfo actionInfo; // should this be filled out? If so, what with!
APlayerController* pLocalPC = GEngine->GetFirstLocalPlayerController(GetWorld());
pLocalPC->PlayDynamicForceFeedback(1.f, -1.f, true, true, true, true, EDynamicForceFeedbackAction::Start, actionInfo);
This should cause the controller to vibrate at maximum until I tell it otherwise. Result: nothing.
Using APlayerController::ClientPlayForceFeedback()
FName nameSurface = "SurfaceRumble"; // does this matter? I just made this up here
APlayerController* pLocalPC = GEngine->GetFirstLocalPlayerController(GetWorld());
pLocalPC->ClientPlayForceFeedback(pFFBEffect, true, nameSurface);
This should play pFFBEffect, which is a valid pointer to a UForceFeedbackEffect blueprint, which contains an intensity curve lasting 2 seconds (not that duration should be important since it is set to loop until stopped), on ALL motors. Result: nothing.
Digging around in the Unreal docs doesn’t seem to actually give a working example. Hoping somebody here has some experience and is willing to enlighten me as to my oversight.
Thanks!