Giter Site home page Giter Site logo

jpdante / ue4-joycondriver Goto Github PK

View Code? Open in Web Editor NEW
36.0 4.0 7.0 14.69 MB

Unreal Engine 4/5 Nintendo Switch Joy Con Driver

License: BSD 3-Clause "New" or "Revised" License

C++ 61.14% C 36.70% C# 2.16%
unreal engine unreal-engine-4 unreal-engine unreal-engine-plugin unrealengine plugin joycon nintendo nintendo-switch

ue4-joycondriver's Introduction

UE4-JoyConDriver

Unreal Engine 4/5 Nintendo Switch Joy Con Driver

About

This project is a plugin for Unreal Engine 4.27/5.2 that allows you to connect the Nintendo Switch Joy Cons to Unreal without the need for a driver and allowing you to use its features such as accelerometer, gyroscope and IMU.

Why ?

The drivers for Joy Cons are limited and there are very cool features present in Joy Cons such as motion sensors and HD Rumble, the goal is to allow using these features within Unreal without headaches and with simplicity.

The project is still in alpha, so I would say that it is not yet simple enough.

Requirements

  • At least one Nintendo Switch Joy Con
  • A Bluetooth adapter compatible with Joy Con
  • Unreal Engine 4.27/5.2

API Reference

Known issues

  • When connecting a Joy Con in the editor it will remain connected even after the simulation/play is over and will stop working when playing again, the only solution is to resume de connection with ResumeConnection node.

Assets Copyright

Nintendo Switch Inspired Controller (JoyCon Plus)

Published on Jan 27, 2021 By Harry Felton (harryfelton)

License: Commercial use is allowed, you must attribute the creator, you may remix this work and the remixed work should be made available under this license.

https://www.youmagine.com/designs/27960

ue4-joycondriver's People

Contributors

jpdante avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ue4-joycondriver's Issues

How to use on Mac?

Hello,
I'd like to use the plugin, but I'm running Unreal Engine 4.27 on a Macbook. I cannot open the project due to this error:
The following modules are missing or built with a different engine version:
JoyConSample
JoyConDriver
I click on rebuild, but eventually it quits with this error:
JoyConSample could not be compiled. Try rebuilding from source manually.

Exception thrown: read access violation, when using the C++ API

When using the C++ API a read access violation is thrown when trying to use the JoyConModule* after importing the Module like the Wiki page described. Tested in Unreal Versions 4.25.4 and 4.27.2.

void AMyCharacter::BeginPlay()
{
	Super::BeginPlay();

	TArray<IJoyConDriverModule*> JoyConInputApis = IModularFeatures::Get().GetModularFeatureImplementations<IJoyConDriverModule>(IJoyConDriverModule::GetModularFeatureName());
	for (IJoyConDriverModule* JoyConInputApi : JoyConInputApis) {
		if (JoyConInputApi == nullptr) continue;
		JoyConModule = JoyConInputApi;
		break;
	}

	if (JoyConModule != nullptr) {
		TArray<FJoyConInformation>* FoundControllers = JoyConModule->SearchForJoyCons();

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff on JoyConModule in the last line.

Can be replicated in the provided sample project in the repository. Simply create a C++ class inheriting from character and copy the code from the CppMotionTest Actor that's already in the project or from the wiki and place it in the scene. Access Violation doesn't occur when using the blueprint api instead of the c++ api for these drivers.
However when using blueprint and opening the project as ndisplay/switchboard application unreal engine will still crash. Below is the Crash Log for ndisplay (only tested in 4.27).

[2022.05.02-19.42.19:047][  0]LogWindows: Windows GetLastError: Der Vorgang wurde erfolgreich beendet. (0)
[2022.05.02-19.42.24:631][  0]LogWindows: Error: === Critical error: ===
[2022.05.02-19.42.24:631][  0]LogWindows: Error: 
[2022.05.02-19.42.24:631][  0]LogWindows: Error: Assertion failed: IsValid() [File:C:\ProgramData\EpicGames\UE_4.27\Engine\Source\Runtime\Core\Public\Templates/SharedPointer.h] [Line: 890] 
[2022.05.02-19.42.24:631][  0]LogWindows: Error: 
[2022.05.02-19.42.24:631][  0]LogWindows: Error: 
[2022.05.02-19.42.24:631][  0]LogWindows: Error: 
[2022.05.02-19.42.24:631][  0]LogWindows: Error: [Callstack] 0x00007ffa4d974f69 KERNELBASE.dll!UnknownFunction []
[2022.05.02-19.42.24:631][  0]LogWindows: Error: [Callstack] 0x00007ff9f1ee0216 UE4Editor-Core.dll!ReportAssert() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformCrashContext.cpp:1644]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f1ee4218 UE4Editor-Core.dll!FWindowsErrorOutputDevice::Serialize() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsErrorOutputDevice.cpp:78]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f1c0242d UE4Editor-Core.dll!FOutputDevice::LogfImpl() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\OutputDevice.cpp:61]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f1b56a45 UE4Editor-Core.dll!AssertFailedImplV() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:104]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f1b580a0 UE4Editor-Core.dll!FDebug::CheckVerifyFailedImpl() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Private\Misc\AssertionMacros.cpp:461]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ae77f6ce UE4Editor-JoyConDriver-0001.dll!FJoyConDriverModule::ResumeJoyConConnection() [C:\Users\...\Documents\Git\UnrealCave\Plugins\JoyConDriver\Source\JoyConDriver\Private\JoyConDriverModule.cpp:28]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ae77f825 UE4Editor-JoyConDriver-0001.dll!UJoyConDriverFunctionLibrary::ResumeJoyConConnection() [C:\Users\...\Documents\Git\UnrealCave\Plugins\JoyConDriver\Source\JoyConDriver\Private\JoyConDriverFunctionLibrary.cpp:14]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ae783386 UE4Editor-JoyConDriver-0001.dll!UJoyConDriverFunctionLibrary::execResumeJoyConConnection() [C:\Users\...\Documents\Git\UnrealCave\Plugins\JoyConDriver\Intermediate\Build\Win64\UE4Editor\Inc\JoyConDriver\JoyConDriverFunctionLibrary.gen.cpp:169]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f3cfbe99 UE4Editor-CoreUObject.dll!UObject::execCallMathFunction() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:956]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f3cd4d8d UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1093]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f3ca341a UE4Editor-CoreUObject.dll!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:924]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f3cd497c UE4Editor-CoreUObject.dll!ProcessLocalFunction() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1154]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f3cd4d8d UE4Editor-CoreUObject.dll!ProcessLocalScriptFunction() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1093]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f3cd4184 UE4Editor-CoreUObject.dll!UObject::ProcessInternal() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1181]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f39f19c4 UE4Editor-CoreUObject.dll!UFunction::Invoke() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:5679]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9f3cd3ca3 UE4Editor-CoreUObject.dll!UObject::ProcessEvent() [D:\Build\++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2018]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ee9a942a UE4Editor-Engine.dll!AActor::ProcessEvent() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:863]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ee977435 UE4Editor-Engine.dll!AActor::BeginPlay() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:3579]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ee980c1f UE4Editor-Engine.dll!AActor::DispatchBeginPlay() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:3519]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9efd8ba95 UE4Editor-Engine.dll!AWorldSettings::NotifyBeginPlay() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\WorldSettings.cpp:247]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ef0cca31 UE4Editor-Engine.dll!AGameStateBase::HandleBeginPlay() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\GameStateBase.cpp:205]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9efd2fb3e UE4Editor-Engine.dll!UWorld::BeginPlay() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\World.cpp:4416]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9efc5e611 UE4Editor-Engine.dll!UEngine::LoadMap() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:13264]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9d9d5479c UE4Editor-DisplayCluster.dll!UDisplayClusterGameEngine::LoadMap() [D:\Build\++UE4\Sync\Engine\Plugins\Runtime\nDisplay\Source\DisplayCluster\Private\Game\EngineClasses\Basics\DisplayClusterGameEngine.cpp:275]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9efc089a3 UE4Editor-Engine.dll!UEngine::Browse() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:12463]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff9ef0edbfe UE4Editor-Engine.dll!UGameInstance::StartGameInstance() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\GameInstance.cpp:584]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff681ea3290 UE4Editor.exe!FEngineLoop::Init() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4054]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff681ec0e42 UE4Editor.exe!GuardedMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:160]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff681ec10ba UE4Editor.exe!GuardedMainWrapper() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff681ec40dd UE4Editor.exe!LaunchWindowsStartup() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:273]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff681ed5984 UE4Editor.exe!WinMain() [D:\Build\++UE4\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:320]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ff681ed853a UE4Editor.exe!__scrt_common_main_seh() [d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ffa4e547034 KERNEL32.DLL!UnknownFunction []
[2022.05.02-19.42.24:632][  0]LogWindows: Error: [Callstack] 0x00007ffa4fe62651 ntdll.dll!UnknownFunction []
[2022.05.02-19.42.24:632][  0]LogWindows: Error: 
[2022.05.02-19.42.24:710][  0]LogExit: Executing StaticShutdownAfterError
[2022.05.02-19.42.24:738][  0]LogWindows: FPlatformMisc::RequestExit(1)
[2022.05.02-19.42.24:738][  0]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
[2022.05.02-19.42.24:738][  0]LogCore: Engine exit requested (reason: Win RequestExit)
[2022.05.02-19.42.24:745][  0]Log file closed, 05/02/22 21:42:24

Does it support Mac?

I was wondering if it supports macOS because I bought a Mac and it will be delivered in a few days. My goal is to make a game for the Mac. I'm working on my own game engine, but it's not nearly as powerful as Unreal (which is obvious). So I was just wondering 😄👍

'Axis1D' is not a member of 'FKeyDetails'

Cannot run the project with this plugin due to compilation error - JoyConInput.cpp: [C2039] 'Axis1D': is not a member of 'FKeyDetails'
Am I supposed to add 'Axis1D' option to FKeyDetails enum manually or what?
Screenshot 2023-03-16 151122

Editor Crash when using the Plugin

Thanks so much for this cool Plugin.

I'm encountering Crashes when using it (I'm using unreal 4.24.1). It happens a few seconds after opening the project and pressing Play. I have to say I didn't convert my Project into C++ as suggested in the Getting Started section as I don't know how to do this ; nor opened my project in Visual Studio.

Here's the Crash log :

Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMemory.cpp] [Line: 186] Ran out of memory allocating 252 bytes with alignment 0

UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_Core
UE4Editor_JoyConDriver!FJoyConInformation::FJoyConInformation()
UE4Editor_JoyConDriver!FJoyConInput::SearchJoyCons() [C:\Users\Yuki\Documents\Unreal Projects\ProjectName\Plugins\JoyConDriver\Source\JoyConDriver\Private\JoyConInput.cpp:182]
UE4Editor_JoyConDriver!FJoyConDriverModule::SearchForJoyCons() [C:\Users\Yuki\Documents\Unreal Projects\ProjectName\Plugins\JoyConDriver\Source\JoyConDriver\Private\JoyConDriverModule.cpp:16]
UE4Editor_JoyConDriver!UJoyConDriverFunctionLibrary::SearchForJoyCons() [C:\Users\Yuki\Documents\Unreal Projects\ProjectName\Plugins\JoyConDriver\Source\JoyConDriver\Private\JoyConDriverFunctionLibrary.cpp:60]
UE4Editor_JoyConDriver!UJoyConDriverFunctionLibrary::execSearchForJoyCons() [C:\Users\Yuki\Documents\Unreal Projects\ProjectName\Plugins\JoyConDriver\Source\JoyConDriver\Public\JoyConDriverFunctionLibrary.h:16]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_Engine
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor_UnrealEd
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

Also, Joycons sticks are set into the wrong category in the Inputs tab (under Keyboard).

Cross-Platform Support

I wanted to try this in the editor on MacOS. Is it possible to add the correct platform code from the original HIDAPI implementation and just add just use unreal platform build system inside build.cs to create some preprocessor definitions? I'm not too familiar with HIDAPI which is why I'm asking. Less of an issue and more a feature request that I'm starting to work on looking for insight.

modificar o accelerometer

não é um bug mas uma pergunta que estou tentado descobrir como eu não conheço muito e estou aprendendo unreal você sabe como eu posso modificar(se é possível via blueprint) as variáveis do acelerômetro, giroscópio ou eu tenho que modificar via código, exemplo quando eu conecto os joy con as variáveis deles começam meio que em uma posição diferente e gostaria de modificar isso para quando eu iniciar poder seta a variável.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.