Oculus Rift

Oculus Rift

wolfgang_ortner
Contributor Contributor
1,588 Views
9 Replies
Message 1 of 10

Oculus Rift

wolfgang_ortner
Contributor
Contributor

Hey guys,

 

I am new to this forum...so Hello everybody!

 

I have a question and I am sure it is a total beginner question :o(

 

How can I use Oculus Rift on the Level that I created.

I started with the VR Preset scene - created a new level.

But if I play the level, it would always bring me to the template floorplan scene (the oculus works just fine on that scene)...I am not able to play the level I created.

 

Can I simply delete the template scene to force Stingray to use the only level in the scene?

or is there a setting that I have missed?

 

Can I also use the Oculus out of an empty scene template or do I have to start with the VR template?

 

thanks guys, have a good weekend

Wolf

 

Reply
Reply
0 Likes
Accepted solutions (1)
1,589 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Accepted solution

You have to change your project.lua script to tell it what level to open.  Open your project.lua file and around line 10 you should see 

 

Project.level_names = {
	menu = "content/levels/main_menu",
	floorplan = "content/levels/floorplan"

add your new level below and give it a name, then specify the path of the level in the folder structure, for example, classroom is my new level:

 

Project.level_names = {
	menu = "content/levels/main_menu",
	floorplan = "content/levels/floorplan",
	classroom = "content/levels/Classroom"
}

Make sure you add the comma after the previous level.  That tells the project there is another level.  If you want that level to start by default, scroll down to around line 37.  There you should see this code, but instead of "classroom" it should say "menu."  Just change menu to the new name you gave your level in the above step.  That level should now open by default when you run the project.

 

SimpleProject.config = {
	standalone_init_level_name = Project.level_names.classroom,

 

Reply
Reply
Message 3 of 10

wolfgang_ortner
Contributor
Contributor
thank you for your detailed description!

...has the dev.team ever looked at other enginges how they do it?
eg UE4 has a simple button...play in Rift. no scripts.
that would be very handy to have that option for the play button

thanks
wolf



Von Samsung-Tablet gesendet
Reply
Reply
0 Likes
Message 4 of 10

dan.matlack
Alumni
Alumni
If you are using the oculus VR template, all you have to do is hit the green 'test level' button to run your current level with VR. Using the 'run project' button will run the entire project starting from the menu level -- you will have to set up your project the way you want it to run for you.
______________________________________
Dan Matlack
Senior Content Manager || Games Solutions
Autodesk, Inc.
Reply
Reply
Message 5 of 10

wolfgang_ortner
Contributor
Contributor
Interesting…that was the reason why I asked in the first place.
Hitting the green arrow plays the level but not in VR.
I can change with CTRL Enter through the view but there will not be an Oculus view.



Gesendet von meinem Windows 10 Phone
Reply
Reply
0 Likes
Message 6 of 10

dan.matlack
Alumni
Alumni
I will check into that for you. We may have changed that functionality. Run Project will definitely initialize the VR though. Test Level should ... but if it's not, I'll look into it.
______________________________________
Dan Matlack
Senior Content Manager || Games Solutions
Autodesk, Inc.
Reply
Reply
0 Likes
Message 7 of 10

wolfgang_ortner
Contributor
Contributor
thanks! much appreciated



Von Samsung-Tablet gesendet
Reply
Reply
0 Likes
Message 8 of 10

Anonymous
Not applicable

Similarly,

 

Say I start with the empty template, make a beautiful scene, then would like to add VR support. Do I simply replace my project file with the VR template file, rename the level paths, add the oculus_vr and Oclus_VR_INPUT_MAPPER, and voila! project is now rift capable?

Reply
Reply
0 Likes
Message 9 of 10

dan.matlack
Alumni
Alumni
That's sort of the idea 🙂 However, the "empty" template has no hooks at all to the appkit. It's mostly for people who want to code their own basic functionality. If you want to have proper VR with a character with movement and cameras, etc ... start with the VR template and build your scene there.
______________________________________
Dan Matlack
Senior Content Manager || Games Solutions
Autodesk, Inc.
Reply
Reply
0 Likes
Message 10 of 10

Anonymous
Not applicable

haha, ok duly noted. I just did that and the lighting looks drastically different in the vr template. SIdenote, to save something as a level do objects always have to selected?

 

I'm now trying to run the project in vr after transferring my level to the vr project, changed the name, but am getting an error "vr+project1 /Lua:Script/lua/oculus_vr.lua:283: bad argument #4 to 'render_world' (userdata expected, got nil).

 

Suggestions??

 

Thanks guys for the help btw. 

Reply
Reply
0 Likes