x


how can i directly access USB/COM in unity?

Hi.

I have a FPS game with a gun in game. i want to have an external gun that connects to usb/com port. i want to use the gun for input in my game and allow the players to use the gun for playing the game. something like Wiimote of Wii console but with my own hardware. is it possible or not?if yes, how?

so thanks.

more ▼

asked Feb 23 '10 at 03:31 PM

Milad gravatar image

Milad
245 36 42 60

is the device a popular one. does it have any special driver in C++ or you want to process raw data from USB? (i voted up your question to help)

Feb 23 '10 at 08:02 PM Ashkan_gc

i am looking for a driver or library for that.i want gat info from usb or com http://port.so thanks for VOTE.

Feb 24 '10 at 07:16 AM Milad

Yes, but what Ashkan was asking was which external gun are you referring to? A wiimote based one perhaps? Theres a library for that on the wiki. Hardware interfaces vary a lot - that is why you don't get all systems supporting all hardware out of the box.

Feb 24 '10 at 09:24 AM AngryAnt ♦♦

I need both of them.means that wiimote and my gun.what must i do exactly? if you can gave the library link please. so thanks.

Feb 24 '10 at 10:16 AM Milad

i need more help please.

Feb 26 '10 at 10:09 AM Milad
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

I would think this would be possible; there are various libraries out there for communicating with com/usb devices through C# .NET which you could leverage to do something like this. You could possibly look into having your device emulate the mouse and keyboard as well and just hook into those same inputs. For example when I was doing some controller tests with a proprietary engine which did not support USB game pads I used a mouse/keyboard emulator for that gamepad and then hooked into the mouse/keyboard events for the corresponding actions.

It is really going to depend on the device you are working with, your knowledge of .NET, and the drivers provided for the device you are working with.

more ▼

answered Feb 23 '10 at 05:12 PM

Shawn gravatar image

Shawn
323 5 6 13

(comments are locked)
10|3000 characters needed characters left

find the driver for your device if you really have a known device to use. for using wiimote you can use uniwii. the unify community wiki is a good place to search for scripts and articles that you need.

more ▼

answered Mar 04 '10 at 06:12 AM

Ashkan_gc gravatar image

Ashkan_gc
9.1k 33 56 117

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x46
x22

asked: Feb 23 '10 at 03:31 PM

Seen: 1736 times

Last Updated: Mar 04 '10 at 06:04 AM