Search Unity

Have anyone tried using UWP RacingWheel and ForceFeedback API?

Discussion in 'Scripting' started by Michael542, Dec 4, 2018.

  1. Michael542

    Michael542

    Joined:
    May 21, 2016
    Posts:
    1
    So I have a little project to control racing wheel controller using its force feedback capability.
    Code (CSharp):
    1. #if NETFX_CORE
    2.         Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor f;
    3.         foreach (var racingwheel in Windows.Gaming.Input.RacingWheel.RacingWheels)
    4.         {
    5.             Windows.Gaming.Input.RacingWheel r = racingwheel;
    6.             Windows.Gaming.Input.RacingWheelReading reading = r.GetCurrentReading();
    7.             t.text = reading.Wheel.ToString();
    8.             f = racingwheel.WheelMotor;
    9.             Windows.Gaming.Input.ForceFeedback.ForceFeedbackEffectAxes FFAx = racingwheel.WheelMotor.SupportedAxes;
    10.             t.text = FFAx.ToString();
    11.         }
    12. #endif
    Using above code I am able to print the SupportedAxes and the current angle of the racing wheel but when I tried to give it constant force effect to make it rotate around using the API: https://docs.microsoft.com/en-us/uwp/api/windows.gaming.input.forcefeedback.constantforceeffect
    I always get HRESULT Exception.

    So anyone can help me with this issue? Basically I want to create my custom force feedback effect.

    Any help appreciate! Thank you in advance!
     
  2. unitycis

    unitycis

    Joined:
    May 18, 2017
    Posts:
    5
    Hello Michael

    Did you get the solution to this?
     
  3. WalterAnthony

    WalterAnthony

    Joined:
    Apr 10, 2018
    Posts:
    8
    Has your problem been solved