How can I get input from the Accelerometer?

I try to get the Input Motions datas, but all vectors return 0.

When I rotate my iPad4, values returned are null. Only “Gravity” is modified and return a little value, between 0.010 and 0.040, for one axe only. I don’t think this is the expected values.

There is other discussions with this problem, encountered in C++ and Blueprint :

Here it is my test code. Tick function of the PlayerController :

void AFirstPersonCodePlayerController::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
    
    bool test;
    FVector Tilt;
    FVector RotationRate;
    FVector Gravity;
    FVector Acceleration;

    test=PlayerInput->InputMotion(Tilt,RotationRate,Gravity,Acceleration);

    UE_LOG(LogTemp,Warning,TEXT("RotationRate X : %f / Y : %f / Z : %f"),RotationRate.X,RotationRate.Y,RotationRate.Z);
    UE_LOG(LogTemp,Warning,TEXT("Gravity X : %f / Y : %f / Z : %f"),Gravity.X,Gravity.Y,Gravity.Z);
    UE_LOG(LogTemp,Warning,TEXT("Acceleration X : %f / Y : %f / Z : %f"),Acceleration.X,Acceleration.Y,Acceleration.Z);
}

Hi Eddy71. Thank you for your feedback regarding using the accelerometer in your tablet. We are aware that the motion controls are not currently returning values, and plan on rectifying the situation soon.

Have a great day.

Hi ,

I’m glad to hear it.

Have a nice day

Hi Eddy71,

Have you been able to successfully use the accelerometer for input? I will be marking this post as resolved for tracking purposes, but please feel free to reopen it if you still need assistance.

Hi ,

“Get Input Motion State” now return values. Soon more tests for integration in my project. I will get back to you if I encounter problems.

Thanks.