Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I thought that might be the case, but in the Steam VR tutorials I've seen, when I go in to test the environment, the xbox controller does nothing to move me (the camera) around, even though out of the box moving my head around does move the camera, at least where I'm looking. In other words I want to be able to look around AND move fwd/back/left/right. The Steam VR "camera rig" object I'm told to drop in has a left and right controller, and I have to drop a "tracked controller" script onto each of those, but all that does is add recognition of the touch controllers.
Assuming there's nothing special about the camera in the Steam VR camera rig object, how do I move the camera (player) when I move the joystick(s) on the xbox controller?
I understand that there's scripting involved. I've been doing lots of that with UI work. But given that there is nothing intuitive about Unity whatsoever, it is simply not obvious in any way how make the game camera move with an xbox controller, let alone do so in the Steam VR setup. I've searched quite a bit and, as I said, I can only find examples of using the touch controllers. And even in those examples the touch controllers aren't used to translate camera position.
To be fair, while i think Unity's controller input system is rather bad, it's very easy to find examples of how to integrate simple controller support into your project and it has nothing directly to do with SteamVR.
I suggest looking at this page for a reference on the button keys:
http://wiki.unity3d.com/index.php?title=Xbox360Controller
For the best standard controller input control, i would recommend buying ReWired on the Asset store:
https://www.assetstore.unity3d.com/en/#!/content/21676
In order to move a SteamVR player, you will need to parent the player camera to some kind of pivot object, usually i would structure it like this:
Player--->Camera Pivot--->Player Camera
Keep in mind you should always move a player relative to the facing direction of the camera, so you will need to calculate the movement from the direction of the camera and apply the movement to the camera pivot object.
Keep in mind when rotating the pivot, the SteamVR camera will also be rotated with the offset from the Pivot center, so you will need to rotate the pivot object around the camera.
The SteamVR rig has a usable hiarchy for manipulating the origin position and orientation of the camera within the scene, you would however have to manipulate "[CameraRig]". In order for the camera to move forward, you can just manipulate the position without any major issues, but rotating the camera will make your end users very sick if you just rotate the SteamVR rig itself, since the actual camera will not locally be positioned in (0,0,0), so you will need to rotate the rig around the "Camera (Head)" object.
You are supposed to at least add the Axis of the sticks to the input manager(i believe Horizontal and Vertical already corresponds to one of the sticks), the button states can be gotten using the Unity Input class from code.
It is important to note that you absolutely do not need all the stuff in the rig, a standard Unity camera will get the head tracking applied as long as the project supports OpenVR.
I appreciate the help.