MrTimcakes / Unity-DirectInput

Unity Native Plugin to expose DirectX DirectInput ForceFeedback
GNU Lesser General Public License v3.0
31 stars 11 forks source link

[Help] I can't get Unity-DirectInput working #2

Closed human890209 closed 2 years ago

human890209 commented 2 years ago

Hi, I followed the Quick Start 100%, but I failed and got unity console errors.

1) Install Unity 2021.1.16f1 on my Win10 64bit pc. 2) Create a new unity project (3D Core). 3) Install Input System 1.02 successfully. 4) Install Unity-DirectInput with Package Manager > Add package from git URL : https://github.com/MrTimcakes/Unity-DirectInput.git 5) Package Manager showed Unity-DirectInput 0.5.5 is installed, but the unity console displays errors: meta file missing

I tried to import Unity-DirectInput manually to generate the meta files.

6) Remove Unity-DirectInput with Package Manager. 7) Download Unity-DirectInput-main.zip from Github. 8) Unzip it, got [Unity-DirectInput-main] folder. 9) Drag [Unity-DirectInput-main] into the unity project's Assets to import them. 10) Unity console showed DLL not found Error. dll not found 11) Delete the [Unity-DirectInput-main] folder in the unity project's Assets. 12) Package Manager > Add package from disk... Select package.json file in local [Unity-DirectInput-main] folder. 13) Package Manager showed [Unity-DirectInput 0.5.5] installed. 14) I see new menus here, click all the 3 option, got the same DLL not found errors in the unity console. dll not found 2

human890209 commented 2 years ago

I hope there is a simple tutorial video. Eg: Creating a simple unity project using the brake and throttle Paddles to turn the steering wheel left and right slowly.

MrTimcakes commented 2 years ago

Hey, I've updated the repo to include those .meta files, and I've tried importing from the Git URL in a blank project and everything seems to be working. The "FFBDev" menu shouldn't be needed as the plugin should auto-detect devices and even handle hot-plugging devices, the menu is there in case you run into issues tinkering.

Yeah, some proper documentation and perhaps a video guide would be nice when the plugin reaches version 1.0. As of right now the plugin is still under development and pieces are likely to change, particularly surrounding the ForceFeedback.

Let me know if you get it working.

human890209 commented 2 years ago

Hi, With the new version, I can install Unity-DirectInput with Package Manager > Add package from git URL : https://github.com/MrTimcakes/Unity-DirectInput.git. But I still got the DLL Not Found Exception console error: DLLNotFoundException

human890209 commented 2 years ago

I found this: https://forums.naturalpoint.com/viewtopic.php?t=19999 I didn't install VS......

human890209 commented 2 years ago

I installed VS but still got the DLLNotFound console error. I'm going to install [Microsoft Visual C++ Redistributable latest supported downloads]

MrTimcakes commented 2 years ago

Does the development application under "Unity-DirectInput\DirectInputExplorer~\DirectInputExplorer\bin\Debug\net5.0-windows\DirectInputExplorer.exe" work for you at all?

human890209 commented 2 years ago

I replace the DLL file in Plugin/DLL with this x64 released one. And the unity console DLLNotFound error is gone. replace Seems the old DLL file is a debug version which is 423kb. This trick is from Logitech Unity Toolkit reviews. I guess maybe most users lack some debugging environment and the release version is fine.

MrTimcakes commented 2 years ago

Aaah, I must've only built the latest version only as a Debug build instead of a Release. Although it seems you've got it working now?

human890209 commented 2 years ago

Yes. The released DLL file works.