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.

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.

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.