Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTony Shaat
70 PointsCan i use Samsung Gear VR with this course?
I don't have a device oculus rift or HTC vive.
Sean Gallagher
2,054 PointsAgreed. Wish they showed how you build for Gear. It would be nice if they at least showed how to build for Android since I don't see how that's done either amongst the available videos.
1 Answer
Mark Dawe
2,087 PointsI have not finished the course using GearVR but so far I have been able to build the demo application and tweak its settings until I got an acceptable frame-rate on Gear VR. The main tweaks I had to make were to disable all real time lighting, bake everything, as well as disabling the cloth physics for the net. (remove the cloth component on the net objects)
I also set most the the lighting and shadow settings to much lower quality. Once I did that I can build the game and have it keep the 60fps needed on Gear.
I am going to attempt to continue with the course but its possible the things I disabled are a key part of the course and I will get stuck having to try and work around it again. I figure either way I will learn something.
In summary, its possibly not impossible.
P.S. Getting it to build for android at all is a whole other ballpark and semi complicated. You need the android SDK and the Gear VR SDK and then you have to register your phone to get a special key file that you put in your Project/Assets/Plugins/Android/assets/ folder of your project to allow it to run on your phone.
I followed the instructions here
Mark Dawe
2,087 PointsOk! I just finished this course using the Gear VR and a Samsung S7. It really wasn't too bad.
The changes I had to make were:
Turn off real time lighting. Bake the lighting Disable Physics on the net (This one was killer on the framerate) Change all instances of the text "Press Space" to "Tap"
To make it so you can start the game by tapping instead of using spacebar, within GameManager.cs and void Update()
I commented out:
//if(!gameStarted && Input.GetKeyUp(KeyCode.Space))
and replaced it with:
if(!gameStarted && Input.GetMouseButtonUp(0))
Gear VRs pad acts like a mouse so Input.GetMouseButtonUp works for that purpose.
I disabled the code that lets you aim with the mouse, the touch pad is weird to use that way and didn't really let you aim using it.
So in MouseRotation.cs, I commented out:
void Update () {
// Add mouse movement to the target angles, multiplied by the rotation sensitivity.
//going to comment out a lot of teamtreehouse stuff for testing.
//targetAngle.y += Input.GetAxis("Mouse X") * rotationSensitivity;
//targetAngle.x += Input.GetAxis("Mouse Y") * rotationSensitivity;
// Lock the X and Y target angles to the rotation range.
//targetAngle.x = Mathf.Clamp(targetAngle.x, -rotationRange.x * 0.5f, rotationRange.x * 0.5f);
//targetAngle.y = Mathf.Clamp(targetAngle.y, -rotationRange.y * 0.5f, rotationRange.y * 0.5f);
// Update the rotation of the game object by multiplying the start rotation by the target angle rotation.
//transform.localRotation = startRotation * Quaternion.Euler(-targetAngle.x, targetAngle.y, 0);
}
To add the ability to aim at where you are looking within ThrowObject.cs and ReleaseObject()
I commented out:
// objectRigidBody.AddRelativeForce(throwingObject.transform.forward * objectForce);
and added:
objectRigidBody.AddRelativeForce(Camera.main.transform.TransformDirection(Vector3.forward * objectForce));
That was just about it!
Hopefully this will help anyone else that wants to attempt this.
k f
42 Pointsk f
42 PointsThis was my very first question too and it's concerning there's no answers yet, almost two weeks after the original question was posted.