Skip to content

Plugin with full support for the DualSense PS5 controller in Unreal Engine versions 5.3, 5.4, and 5.5 for Windows platforms. No configuration needed

License

Notifications You must be signed in to change notification settings

Deooed/WindowsDualsenseUnreal

 
 

Repository files navigation

Windows Dualsense for Unreal Engine version 5.3, 5.4 and 5.5

Plugin with full support for the DualSense PS5 controller in Unreal Engine versions 5.3, 5.4, and 5.5 for Windows platforms. No configuration needed

No necessary configuration to run the control.

Supports settings of triggers, haptic feedback triggers, unreal native force feedback blueprint, vibrations, leds, battery level, gyroscope, accelerometer etc..

Usage methods available via C++ or Blueprint.

#include "DualSenseProxy.h"

void APlayerController::BeginPlay()
{
    Super::BeginPlay();
	
    int32 ControllerId = 0; 
    
    // It is necessary to change the value to false in PlayerController if HapticFeedback is to be used. SetDisableHaptics(true) is set by default.
    SetDisableHaptics(false);

    // Reset buffer all values 
    UDualSenseProxy::ResetEffects(ControllerId);
    
    // Gyroscope and Accelerometer are set to false by default. Calibration needs to be implemented
    UDualSenseProxy::EnableAccelerometerValues(ControllerId, false);
    UDualSenseProxy::EnableGyroscopeValues(ControllerId, false);

    // Touch pad values default false, values max 1.0f
    UDualSenseProxy::EnableTouch1(ControllerId, false);
    UDualSenseProxy::EnableTouch2(ControllerId, false);

    // Level battery Full load max 100.0f
    float levelBattery = UDualSenseProxy::LevelBatteryDevice(ControllerId);

    // Leds configs
    UDualSenseProxy::LedMicEffects(ControllerId, ELedMicEnum::MicOn);
    UDualSenseProxy::LedPlayerEffects(ControllerId, ELedPlayerEnum::One, ELedBrightnessEnum::Medium);
    UDualSenseProxy::LedColorEffects(ControllerId, FColor(255, 255, 255));

    // Vibrations example 
	PlayDynamicForceFeedback(0.5f, 3.f, true, true, true, true);
	
    // Stop triggers effects
    UDualSenseProxy::StopAllTriggersEffects(ControllerId);
    UDualSenseProxy::StopTriggerEffect(ControllerId, EControllerHand::Left);
    UDualSenseProxy::StopTriggerEffect(ControllerId, EControllerHand::Right);

    // Normalize triggers
    UDualSenseProxy::EffectNoResitance(ControllerId, EControllerHand::Left);
    UDualSenseProxy::EffectNoResitance(ControllerId, EControllerHand::Right);

    // Start position max value 8 | Force max value 9
    UDualSenseProxy::EffectContinuousResitance(ControllerId, 5, 8, EControllerHand::Left); 
    UDualSenseProxy::EffectContinuousResitance(ControllerId, 1, 4, EControllerHand::Right);

    // Start and end positions max value 8
    UDualSenseProxy::EffectSectionResitance(ControllerId, 1, 8, EControllerHand::Left); 
    UDualSenseProxy::EffectContinuousResitance(ControllerId, 5, 8, EControllerHand::Right);

    // Example Haptics Effects...

    // Start position max value 8 | Forces max value 9 
    UDualSenseProxy::SetTriggerHapticFeedbackEffect(ControllerId, 8, 0, 0, 6, EControllerHand::Left, true);
    UDualSenseProxy::SetTriggerHapticFeedbackEffect(ControllerId, 8, 0, 0, 7, EControllerHand::Right, true);

    // SetHapticsByValue is a method of PlayerController.
    SetHapticsByValue(0.1f, 1.0f, EControllerHand::Left);
    SetHapticsByValue(1.0f, 1.0f, EControllerHand::Right);
}

Usage via Blueprints

Unreal Editor

Unreal Editor

Basic example to check connection, reconnect device, and apply LEDs to the DualSense.

Unreal Editor

Haptic trigger feedback

Unreal Editor

Installation

Download the compiled plugin Windows x64

UE 5.3 download plugin WindowsDualsense_ds5w1.0.0.zip

UE 5.4 download plugin WindowsDualsense_ds5w1.0.0.zip

UE 5.5 download plugin WindowsDualsense_ds5w1.0.0.zip

Extract the file to

C:\Program Files\Epic Games\UE_[version]\Engine\Plugins

Now enable the plugin in the Unreal Editor, connect your DualSense device, and restart the editor.

Unreal Editor

After restarting the engine, the following message will appear in the bottom right corner:

Unreal Editor

Native Gamepad Mapping in Unreal

Unreal Editor

The keys for the Gyroscope and Accelerometer are as follows:

Unreal Editor

You don’t need to map the keys. By default, the plugin already maps the standard Gamepad layout.

NOTE: Enable Gyroscope, Accelerometer, and Touch only after mapping the actions to avoid interfering with button press recognition, as Gyroscope, Accelerometer, and Touch constantly emit values.

Unreal Editor

NOTE: It may be necessary to enable haptic feedback in the project settings, under Edit > Project Settings > Input.

Unreal Editor

The plugin is compatible with Unreal's native Blueprints Force Feedback, for example:

Config

Unreal Editor

Result

Unreal Editor

Contributions

Thanks to the DualSense on Windows API library, which facilitated the development of this plugin.

About

Plugin with full support for the DualSense PS5 controller in Unreal Engine versions 5.3, 5.4, and 5.5 for Windows platforms. No configuration needed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.4%
  • C# 1.6%