Oculus Rift Templates - Xbox Controller - nolonger working

Oculus Rift Templates - Xbox Controller - nolonger working

patrick.sullivan
Contributor Contributor
5,043 Views
38 Replies
Message 1 of 39

Oculus Rift Templates - Xbox Controller - nolonger working

patrick.sullivan
Contributor
Contributor

There are several areas to this question, though essentially I just want to use the Xbox controller on projects (once again).

I started on version 1.4 and had used a separate forum discussion (I don't script well) to enable walking and turning with use of the xbox controller and Oculus Rift. With the release of 1.6 I can not make this work, nor can I get any function out of the xbox controller (this is both with use of version 1.4 and with upgrading the file to version 1.6) - I receive the following message: vr_project / Lua:script/lua/oculus_vr.lua:59: attempt to call field 'setup' (a nil value)

 

1) With that said, I would really like to know what happened to the file it was the VR template (before release of Touch templates) and get this running again. I've even tried uninstalling 1.6, but still no use of the original template file when I click "run project"

 

2) With the release of 1.6 I know longer can find a template for use of Oculus Rift. There are two templates available that contain use of Oculus Touch, but I don't have Touch and can no longer do anything that accepts the use of the xbox controller.

 

I installed 1.6 on day one (and uninstalled/ reinstalled a dozen times on three separate computers) and have spent every free moment I have trying to get this xbox issue resolved. I barely know how to use this software, but cant move on till I understand why this function is no longer available - PLEASE HELP (for my sanity 🙂 )

Reply
Reply
0 Likes
Accepted solutions (1)
5,044 Views
38 Replies
Replies (38)
Message 21 of 39

paul.kind
Alumni
Alumni

I will try and do a short tutorial on this sometime this week.  I think it would benefit a lot of you since this seems to be a popular thread.

Ill let you all know when it is up and available.

 

Paul

Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d

Please remember to give kudos freely and mark acceptable answers as solved!

PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.

Did you know there was a YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @ https://www.youtube.com/user/autodeskgameshowtos
Reply
Reply
0 Likes
Message 22 of 39

patrick.sullivan
Contributor
Contributor

Excellent news Paul!! Thanks for the update.

Reply
Reply
0 Likes
Message 23 of 39

Anonymous
Not applicable

That would be brilliant Paul, thank you 🙂

Reply
Reply
0 Likes
Message 24 of 39

paul.kind
Alumni
Alumni

Hope this helps you guys.

 

https://www.youtube.com/watch?v=GVB7JFH_dMo&feature=youtu.be

 

Paul

Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d

Please remember to give kudos freely and mark acceptable answers as solved!

PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.

Did you know there was a YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @ https://www.youtube.com/user/autodeskgameshowtos
Reply
Reply
0 Likes
Message 25 of 39

paul.kind
Alumni
Alumni

ok, so if you watch the above video and can get that to work i have one more goodie you can use.  This will give you forward and backward direction based on head tracking.

 

You will need to add a custom flow node however.

 

1. open up script/global.script_flow_nodes

2. add this block of text below the last } (close curly bracket) but before the last ] (close hard bracket)

 

{
	    name = "Rotate Vector"
	    args = {
	        vector_in = "vector3"
	        rotation = "quaternion"
 	    }
	    returns = {
	        vector_out = "vector3"
	    }
	    query = false
	    function = "ProjectFlowCallbacks.rotate_vector"
	    category = "Project/Math"
}

3. Save and close the script file.

4. Now you need to open up script/lua/flow_callbacks.lua

5. Paste the following block of text after the last "end" statement.  Basically at the very bottom of the file.

 

function my_scripts.rotate_vector(t)
    t.vector_out = stingray.Quaternion.rotate(t.rotation, t.vector_in)
    return t
end

6. save and close the script file.

7. Press F5 to ensure everything gets loaded.

 

Now assuming you followed the video posted above, you just need to add the rotation node you just created to the beginning of the flow sequence like this.  You will also need the HMD Pose node from either the Steam or the Oculus node list.

 

8. In level flow, right click and select Project > Rotate Vector

9.  In Level Flow, rigth click and select SteamVR > SteamVR HMD Pose

 

Connect them to your existing Flow like this (assuming you followed my tutorial above)

 

Capture2.PNG

 

Please note the way the out from the tumbstick is now connected all the way through to the end of the graph.  This is vastly more efficient.

 

Capture.PNG

 

This is the identical functionality to the original Oculus Template.

 

Paul

 

 

 

 

 

Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d

Please remember to give kudos freely and mark acceptable answers as solved!

PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.

Did you know there was a YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @ https://www.youtube.com/user/autodeskgameshowtos
Reply
Reply
0 Likes
Message 26 of 39

paul.kind
Alumni
Alumni
Accepted solution

Hey Guys,

 

OK, so now i have the complete video tutorials available.

 

Here are the 2 parts.  Please "accept and solution" if this solves your issues and satisfies your needs.  I believe it should.

 

The tutorials are located here….

Part 1 : https://www.youtube.com/watch?v=GVB7JFH_dMo

Part 2 : https://www.youtube.com/watch?v=7pjDbmVH0uE&feature=youtu.be

 

Paul

 

Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d

Please remember to give kudos freely and mark acceptable answers as solved!

PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.

Did you know there was a YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @ https://www.youtube.com/user/autodeskgameshowtos
Reply
Reply
Message 27 of 39

patrick.sullivan
Contributor
Contributor

Great work Paul! I just completed both tutorials and things work once again. With that said I did notice a change in the earlier flow that was not noted in the video. There was only one Vector Component versus two after Xbox Input (though it appears you did not need it). Also once I completed efforts from video two, the Reverse Input needed to be changed to '1' versus '-1'.

 

So (3) follow-up questions, based my results:

 

1) my touch controllers are floating next to me, how do I tell the system to remove these? or better yet, can I switch use with a keyboard on/ off. Xbox to Touch.

 

2) Xbox Input for right-stick rotation. I cant help but think of things like Autodesk's stance on Revit Revisions, in that no one should use '0' for IFC. So accordingly no one will use the xbox controller in Stingray in a first person xbox controlled environment..  (though I truly appreciate the lessons Paul!!!)

 

3) I get this blurring affect when moving my HMD (not a loss of fps, but an actual blur). Seems that this was done to help with sickness in movement, however it makes me more sick to see the blur than to not - any way to remove this?

 

Because these follow the "accepted solution" of Paul's efforts, if I don't receive any responses, I'll look to start a new post with these questions.

Reply
Reply
0 Likes
Message 28 of 39

Anonymous
Not applicable

Thank you very much for those tutorials Paul, they have been most helpful! My question now is how can I tie this to a unit in my scene with a mover? I've been doing a bit of playing around and it seems like the method you've worked on will always start the player at 0,0,0? I want to be able to have the headset essentially a child of a unit, and for the controls to drive this unit. I've pretty much got it working, but that's using the output of your flow to set the mover's position. Ideally I want to be able to plug this into a 'move mover' so therefore i'll be able to get collisions and gravity etc. I don't know much about how lua works with collisions and gravity, and that's the reason I want to use a unit to drive the headset.

 

Here's my unit flow, to show you what I currently have:

 

Movement.jpg

 

@PatrickLau17

Are you using HTC vive or oculus? I'm using oculus and if you open up the oculus_vr.lua file, there is a section called 'create vr controllers' around line 60. Just comment these out by putting a -- in front of the line.

 

I've got the right thumbstick to work with rotation but as I've stated above I'm doing it slightly differently in that my headset is being set by a unit's position. Here's my unit flow, hopefully it'll get you in the right direction.

 

RotationRightThumbstick.jpg

 

I too discovered the blurring effect, and this was because I have screen space reflections and screen space ambient occlusion turned on in the level's shading environment. Turning these off fixed it for me.

 

Thanks guys.

 

 

 

Reply
Reply
0 Likes
Message 29 of 39

paul.kind
Alumni
Alumni

Hey guys,

 

I have a baby girl being born right now, but as soon as I am back to my computer with some time to spare, ill look into these questions for you.

 

Paul

Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d

Please remember to give kudos freely and mark acceptable answers as solved!

PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.

Did you know there was a YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @ https://www.youtube.com/user/autodeskgameshowtos
Reply
Reply
0 Likes
Message 30 of 39

patrick.sullivan
Contributor
Contributor

That's excellent news Paul, take your time.

...But not too much time Smiley Very Happy

Reply
Reply
0 Likes
Message 31 of 39

Anonymous
Not applicable

Congrats, Paul!!!!

Reply
Reply
0 Likes
Message 32 of 39

Anonymous
Not applicable

Hi there,

 

I've been looking at this controller function too and I found a pretty good tutorial online:

https://www.youtube.com/watch?v=FrJGc3ZkZLg

 

There is a part one to show how to setup the controller and a part two to use the HMD tracking to control rotation.

It's working pretty well with the touch instead of an xbox controller. Just have to use a different node for the vectors since they are xy in the touch output.

 

Good luck!

Reply
Reply
0 Likes
Message 33 of 39

Anonymous
Not applicable

Will this solution also work with 3ds max interactive?

Reply
Reply
0 Likes
Message 34 of 39

Dustin_Fike
Participant
Participant

I've started setting up a VR level using the unit flow that tbuchan posted.  However, I am having an issue with updating the unit location.  The Oculus left thumbstick moves the camera and the mover of the unit, but it does not move the unit itself.  I used Paul Kind's Super Debugger to read the coordinates for the Mover, the Unit, & the HMD.  The Mover and the HMD move in lockstep.  However, the Unit coordinates do not change.  I am using a cube primitive as the unit that my HMD is linked to.  The cube came with a physics actor already and I have tried changing it to keyframed and dynamic.  I have also tried changing the mover from default to character.  The Unit always stays in place.

 

It may be related to this problem, but I cannot get collisions to work either.  Even though the mover moves, I walk right through walls that have static physics actors.

 

Unit-Flow.jpg

Reply
Reply
0 Likes
Message 35 of 39

Dustin_Fike
Participant
Participant

Well, I was able to get the unit to move by adding a "Set Unit Local Position" node at the end.  See below.  However, it still doesn't rotate with the HMD.  I am not sure if I can and or need to get the mover and unit to rotate when I push the right thumbstick.  I can't find a flow node for getting or setting the Mover rotation like I can for position.  I still don't have collisions working either.

 

Unit-Flow-2.jpg

Reply
Reply
0 Likes
Message 36 of 39

Dustin_Fike
Participant
Participant

Ok.  I got collisions working by using a "Move Mover" node instead of a "Set Mover Position" node.  So, the issues I was having are now resolved.  Now I have a totally new problem related to moving, but I am going to start a new thread for that one.  (The HMD position causes me to move backwards.)

Reply
Reply
0 Likes
Message 37 of 39

Anonymous
Not applicable

Hi Dustin.Fike, I'm working with this same case, but my project dont run. Can you send me the flow image that you used? Please. 

 

Thaks!

Reply
Reply
0 Likes
Message 38 of 39

Dustin_Fike
Participant
Participant

I never got it all working properly.  I was able to get it to move and collide, but it set off another issue where the HMD position would cause undesired movement when the user pushed on the movement stick.  I had some other projects take me away from it for a while at work and I haven't been able to come back and troubleshoot it further.  But you can read about it and see images of the flow here:

 

HMD Position causes Unit Mover to move backwards - ( ‎10-04-2017 11:22 AM ) 

Reply
Reply
0 Likes
Message 39 of 39

Anonymous
Not applicable

Guys, we solved the rotate problem. We need to do a modification on the "Rotata Vector" script, one mistake. After we only conected the level Update to te funtion In of Rotate Vector and work!. After we change the Oculus HDM Pose to Oculus Controller Pose, and then when you point the controller for any side the axis update, I think that way is more real.

 

Thaks for the help!

 

xzc.png

Reply
Reply
0 Likes