r/UnityforOculusGo • • Nov 08 '18

Move an object forwards and backwards with the touch pad

2 Upvotes

Hey,
I want to move an object, after selecting it, along the z axis ( forwards and backwards) by swiping up or down on the go controller touch pad. I am not sure how to do it.

Any help will be greatly appreciated.


r/UnityforOculusGo • • Oct 07 '18

Demo of my game for the Oculus Go (sorry for the mouse :/ )

2 Upvotes

r/UnityforOculusGo • • Sep 18 '18

Help setting up a scene for VR

2 Upvotes

Hi,

I've finally started getting into Unity and it's "easier" and more fun that I expected! I'm following a course from that Humble bundle deal and experimenting a lot myself. C# is not a problem for me, so I have a lot of fun manipulating scenes. :)

I have a question, though. When I build for Oculus Go, I get an empty scene. It's the only scene, I've set the platform to Android and checked the "Virtual Reality Supported" checkbox in the Player Settings. Is there something else I need to do? The simple Oculus tutorial here doesn't really mention anything, but the tutorial posted elsewhere in the sub has a scene that looks way different than mine, camera-wise, etc.

The scene works fine in the game window when I press Play. Any ideas?


r/UnityforOculusGo • • Aug 31 '18

Fluff: Game Dev Documentary - The Making of République

Thumbnail
youtube.com
2 Upvotes

r/UnityforOculusGo • • Aug 29 '18

Simplest Unlit Instanced shader - how to enable switching it on/off (with AlphaTest)?

2 Upvotes

I have a prototype that uses a simple unlit shader that supports instancing where the color is adjustible per instance:

Shader "SimplestInstancedShader"
{
Properties
{
    _Color ("Color", Color) = (1, 1, 1, 1)
}

SubShader
{
    Tags { "RenderType"="Opaque" }
    LOD 100

    Pass
    {
        CGPROGRAM
        #pragma vertex vert
        #pragma fragment frag
        #pragma multi_compile_instancing
        #include "UnityCG.cginc"

        struct appdata
        {
            float4 vertex : POSITION;
            UNITY_VERTEX_INPUT_INSTANCE_ID
        };

        struct v2f
        {
            float4 vertex : SV_POSITION;
            UNITY_VERTEX_INPUT_INSTANCE_ID // necessary only if you want to access instanced properties in fragment Shader.
        };

        UNITY_INSTANCING_BUFFER_START(Props)
            UNITY_DEFINE_INSTANCED_PROP(float4, _Color)
        UNITY_INSTANCING_BUFFER_END(Props)
     
        v2f vert(appdata v)
        {
            v2f o;

            UNITY_SETUP_INSTANCE_ID(v);
            UNITY_TRANSFER_INSTANCE_ID(v, o); // necessary only if you want to access instanced properties in the fragment Shader.

            o.vertex = UnityObjectToClipPos(v.vertex);
            return o;
        }
     
        fixed4 frag(v2f i) : SV_Target
        {
            UNITY_SETUP_INSTANCE_ID(i); // necessary only if any instanced properties are going to be accessed in the fragment Shader.
            return UNITY_ACCESS_INSTANCED_PROP(Props, _Color);
        }
        ENDCG
    }
}
}

I am able to change the per instance color in code without a problem.

However, I want to also be able to make some of the instances disappear in code. The most straightforward and least resource expensive way I found would be to use the AlphaTest Queue and not the Transparent Queue.

However, while there are quite a few resources on how to make that with the Transparent Queue (e.g. https://unity3d.com/learn/tutorials/topics/graphics/making-transparent-shader?playlist=17102), I did not find a good explanation of how to do it with the AlphaTest Queue.

Based on what I have read I have to change

Tags { "RenderType"="Opaque" }

to

Tags {"Queue"="AlphaTest" "RenderType"="TransparentCutout"}

and I would have to use the clip() function in a way that would return hide the whole object if the alpha is set to 0.

I think this could be done by

clip(_Color.a-0.1)

but this is only a wild guess on my part at that point. I have little idea on whether that would work and how to go on from there, or whether I am missing something.

Thanks in advance for the help.

EDIT:I figured it out!. You have to of course refer to the instanced property:

if(UNITY_ACCESS_INSTANCED_PROP(Props, _Color.a) < 0.1) discard;

instead of

clip(_Color.a-0.1);

r/UnityforOculusGo • • Aug 17 '18

Unity UI for Oculus Go controller?

2 Upvotes

I want to overhaul the "UI" of the game that I am developing. Now I don't use any of the Unity's UI system, relying on text elements and quads instead for some basic functionality.

However, I want to convert it to support the Unity's UI system. I read several older posts (from 2015)

https://developer.oculus.com/blog/unitys-ui-system-in-vr/

https://unity3d.com/learn/tutorials/topics/virtual-reality/interaction-vr#anchor

Those 2 links use different approaches to achieve the same thing. One of the comments even mention that the "always on top" shader gives errors in later Unity versions.

Which is the latest state of play on this?

Thanks in advance.


r/UnityforOculusGo • • Jul 15 '18

Windows 7 Machine Won't Request Access of Oculus Go

2 Upvotes

[SOLVED by doing a Factory Reset on the Go]

Hello Everyone,

Someone previously shared this great article that helped me get my computer set up to start playing with Unity and the Oculus Go; https://medium.com/inborn-experience/how-to-build-an-app-for-the-oculus-go-from-start-to-finish-with-unity-cb72d931ddae

Unfortunately, I'm stuck on step 8. In the video on step 8, it mentions the Go should ask if I want to give permission to my computer to access the go. I never get that message.

In my Device Manager, under 'Android Phone' it lists 'Oculus ADB Interface'.

In my ADB folder, all I have is

  • adp.exe

  • AdbWinApi.dll

  • AdbWinUsbApi.dll

  • fastboot.exe

When I run 'command prompt' (as admin) and do C:\Windows\system32>adb devices:

* daemon not running. starting it now on port 5037 *
*daemon started successfully *
List of devices attached

C:\Windows\system32>

Any ideas why my computer isn't seeing my Go? Its plugged in, to my computer, and Go shows its charging.


r/UnityforOculusGo • • Jul 02 '18

What Platform type is Oculus Go in Unity?

2 Upvotes

Just getting started and I'm already stuck. What platform type do I select in Unity for my project? Is it android? When installing, I don't see Oculus Go or VR as an option.


r/UnityforOculusGo • • Jun 26 '18

Smooth movement between teleport points?

2 Upvotes

There's a thing I've noticed in a few games I've played on the Go - where the player selects their next point to move to (either via teleport like in Virtual Virtual Reality, or by selecting a hotspot like in Dead Secret or Land's End) and then after the selection has been made, instead of the player just instantaneously appearing in the new spot, they instead zoom towards it (I can't think of a better term!). Basically you select a point to move to, then the camera/player steadily moves to that selected point. (Actually here's an example of what I'm talking about: https://www.youtube.com/watch?v=73lMCSpr--g)

I just wondered if anyone had figured out how to do that in Unity yet?

I've seen teleport tutorials before, but in any I've seen the player just always instantaneously appears in their chosen teleport spot. Be great if someone could give some pointers on how to achieve this zooming/movement effect!


r/UnityforOculusGo • • Jun 24 '18

(Totally optional) introduce yourself post ...

2 Upvotes

Thought it might be interesting to see what a few folk here are up to, what levels of knowledge we all have, if there's anything specialist we can help others out with, and just get a feel for the kinds of things we're hoping to do with VR ...

I guess it's only fair if I start, and obviously don't feel obliged to introduce yourself if you don't want to for any reason :)

If you came here from my initial post on r/OculusGo then I'm maybe repeating myself, but yeah, I come from a filmmaking and writing background. I've always just been interested in storytelling and deadpan comedy stuff I guess, and my hope is to start making interactive story based games for the Go, kind of in the vein of things like Angest, Dead Secret, Virtual Virtual Reality, etc, but with more of a downbeat/deadpan/absurd vibe I suppose ... (If anyone's curious here's a link my somewhat out of date website, which has a bunch of things I've done in the past ...)

As for my level of knowledge in VR and Unity, it's almost zero. I've owned a Go since about two weeks after it came out, and between then and now, I've started trying to learn Unity and Blender, and plan to learn C# too. I've got all sorts of ideas for games - both really simple/stupid ones and also a couple of longer story type ideas, but for now I'm still just trying to get my head around how to do the things I want in VR, cluttering up my computer with endless unfinished Unity projects, as i try to work out things like teleporting, interactive objects, etc, etc.

So in terms of stuff I can offer and help with, I'm good at ideas in a writing/story/artistic sense (although not sure how helpful that is here!) and I have also managed to do really basic stuff 'getting started' stuff, so happy to chip in there where I can. And hopefully all the annoying beginner's questions I'm planning to ask all the time will be useful to others stumbling across these posts in the future too ... :)


r/UnityforOculusGo • • Jun 22 '18

Easy Input for Gear VR

2 Upvotes

https://assetstore.unity.com/packages/tools/input-management/easy-input-for-gear-vr-88829

This is a pretty useful asset but it DOES require some C# knowledge if you want to deviate from the basics ... The dev is really helpful and responds to messages really quickly and thoroughly, but the documentation is frustratingly lacking and already assumes you have a ton of knowledge about Unity and coding. It's only 'easy' if you already know what you're doing! But still, worth a look!


r/UnityforOculusGo • • Jun 22 '18

Simple FPS Tutorial (in a foreign language!)

2 Upvotes

r/UnityforOculusGo • • Jun 22 '18

Simple VR Gaze input tutorial

2 Upvotes

r/UnityforOculusGo • • Apr 01 '20

Using Video Player

1 Upvotes

After importing the Oculus Integration package, any video player I put one of my mp4 files into will crash the application. Making an empty video player is fine but as soon as I add an mp4 file to it, it crashes. I've removed the vulkan API as well as tried both mono and IL2CPP scripting backends. Any thoughts?


r/UnityforOculusGo • • Jul 25 '19

Oculus Platform returning Error in unity?

Thumbnail
self.oculusgo
1 Upvotes

r/UnityforOculusGo • • Jun 06 '19

Apps listing as "incompatible" in the store but build and sideload normally. (Unity Help)

1 Upvotes

Hi everyone!

I have been developing for the Go since it came out, and I remember having some trouble setting everything up at first, but nothing like the issues now.

While trying to update everything to unity 2018.4 I had many issues which have mostly been solved (signing V2/V3, etc) and warnings that building for 64bit will be required, and an issue with the manifest permissions (READ_PHONE_STATE) all have been solved (I mention in case context helps to troubleshoot). Now the only issue I am getting is that when I upload it to the store, it appears in the headset grayed out with an X and says "incompatible", but when I sideload or build to the device it works normally. I have emailed Oculus support but so far I haven't heard back and I can't find any other threads anywhere that seem to have a similar issue.

I have tried using a few versions of unity and the NDK with no luck.

Other info:

Build Tools - 28.0.2 (I am using the 15 second adb from google but this hasn't been an issue in the past)

Unity - 2018.4

NDK - r16b

Java SE Development Kit - 8u11

Most recent versions of Oculus Integration and Utilities

I have also tried using the Interactive 360 library

Any ideas are appreciated. Thanks!


r/UnityforOculusGo • • Apr 30 '19

OVRplayercontroller jump

1 Upvotes

Hi all,

I'm looking to have my character jump when the oculus go controller trigger is pressed. Does anyone know how to go about this? I have seen that in the OVRplayer script, jump must be enabled but I don't know how to do that.

Thanks


r/UnityforOculusGo • • Apr 28 '19

Is it possible to scroll through UI elements without the pointer pointing on said elements?

1 Upvotes

Hi everybody!

I want to attach UI elements to the controller anchor and scroll through them. I'm able to use the EventSystem with the OVRInputManager and the OVRRaycaster, but since the UI Elements are attached to the controller, the controller can not point at them and they are not active.

Is it possible to scroll through these UI elements with a swipe of the touchpad and make a selection with a push on the touchpad?

Thanks!


r/UnityforOculusGo • • Apr 25 '19

OVR player prefab not responding to Go remote

1 Upvotes

Hi all,

I'm building a basic unity environment for the oculus go and want the player to be able to walk around. I tried using the OVR player prefab as the usual FPS one didn't work, and that didn't work - I could look around, but not walk. Next I found someone that said you have to make the remotes children of the left and right hand anchors in the prefab - did that and no dice. Is there something simple I could be missing? Or does anyone have a simple resource outlining how to make a player from scratch for the Go? I have little scripting knowledge so while I can follow along tutorials, making up my own scripts is a bit beyond me.

Thanks!


r/UnityforOculusGo • • Dec 12 '18

Low GPU utilization issues?

1 Upvotes

When using the Oculus go profiler in unity it shows the total utilization of the GPU, but it's never gone over maybe 1/20th of it's total yet most of my performance issues we're because of too detailed graphics. Am I doing something wrong? Why is my CPU handling rendering for the most part rather than the GPU?


r/UnityforOculusGo • • Dec 11 '18

Player movement options

1 Upvotes

I'm currently using the default player controller for Oculus in which movement is facilitated by swiping on the track pad(if that's what it's called?), I'd love to make it just follow your finger as you move it. So moving your finger forward would make constant forward motion. Is there an easy way to modify the default scripts or has someone made support for something like this? Let me know what you guys are using! Thanks!


r/UnityforOculusGo • • Dec 11 '18

Oculus Go - UI interaction with the controller

1 Upvotes

Hi guys,
I am casting a ray fro the controller and see if there's an object in front of it and interact with it. I have used the following script for that:
using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class PlayerPointer : MonoBehaviour

{

//Returns whatever object is infront of the controller

private GameObject pointerOver;

[SerializeField]

//Is the object that is currently intractable

private PropBase selectedObject;

//Is the object currently stored in hand, ready to throw.

[SerializeField]

private PickUp inHand;

//This is a refrance to the object we want the pointer to be cast from.

[SerializeField]

public Transform controllerRef;

//This is where we want object we are holding to appear

[SerializeField]

private Transform holdingRef;

//The amount of force we want to throw objects from our hand with.

[SerializeField]

[Range(2, 50)]

private float throwForce = 30;

//The script that handles the visuals to show what object is selected

[SerializeField]

private HighlightObject selectVisual;

private LineRenderer line;

void Start()

{

line = GetComponent<LineRenderer>();

}

void Update()

{

//If a object is currently being held I don't want to select another object until it is thrown.

if (inHand == null)

{

WorldPointer();

}

else

{

line.SetPosition(0, controllerRef.position);

line.SetPosition(1, controllerRef.position);

pointerOver = null;

}

//This function handles how you intract with selected objects

Intract();

}

//This function handles shooting a raycast into the world from the controller to see what can be intracted with.

void WorldPointer()

{

//We set the line visual to start from the controller.

line.SetPosition(0, controllerRef.position);

RaycastHit hit;

//We reset the pointer so things don't stay selected when we are pointing at nothing.

pointerOver = null;

//This sends a line from the controller directly ahead of it, it returns true if it hits something. Using the RaycastHit we can then get information back.

if (Physics.Raycast(controllerRef.position, controllerRef.forward, out hit))

{

//Beacuse raycast is true only when it hits anything, we don't need to check if hit is null

//We set pointerOver to whatever object the raycast hit.

pointerOver = hit.collider.gameObject;

//We set the line visual to stop and the point the raycast hit the object.

line.SetPosition(1, hit.point);

//Here we check if the object we hit has the PropBase component, or a child class of its.

if (pointerOver.GetComponent<PropBase>())

{

//We set the object to be highlighted

selectVisual.NewObject(pointerOver);

}

else

{

selectVisual.ClearObject();

}

}

else

{

//If the raycast hits nothing we set the line visual to stop a little bit infrount of the controller.

line.SetPosition(1, controllerRef.position + controllerRef.forward * 10);

selectVisual.ClearObject();

}

Debug.DrawRay(controllerRef.position, controllerRef.forward * 10, Color.grey);

}

void Intract()

{

//We set up the input "OculusPrimaryIndexTrigger" in the Input manager

if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger))

{

{

selectedObject.Trigger();

}

//If you have a object that you need to hold down a button to intract with

}

else if (pointerOver != null)

{

if (pointerOver.GetComponent<PropBase>())

{

selectedObject = pointerOver.GetComponent<PropBase>();

}

else

{

selectedObject = null;

}

}

else

{

selectedObject = null;

}

}

}

Now I created a UI interface,and in the canvas I added few buttons, which I want to interact with using this ray, however this ray just goes through them.
I have added the OVR Input Module script to the Event system and have replaced Graphic Raycaster with OVR ray caster in the canvas and has also changed the render mode to world space in the canvas.
However, i can still not interact with the UI buttons with this ray.
Can someone please help me with this issue! Any help will be greatly appreciated.


r/UnityforOculusGo • • Nov 24 '18

Oculus Go - OVRInput interaction with 3-D objects with Gaze

1 Upvotes

Hello,

I'm developing for the Oculus Go using Oculus OVR, using Gaze input.
I've been able to use world space UI's to interact with UI buttons and the sort. Now, I created 3-D buttons using 3-D objects and for some reason I find it difficult to find a way to get the Gaze Input to collide or detect the 3-D buttons. Basically, I just need the 3-D buttons to react when they're gazed at, the 3-D button prefab has a collider, but the Gaze input passes through it. I'm not sure if I have to create a OnTrigger Event on the button, or is there a way to make that 3-D button intractable with the OVR gaze pointer?

Before you ask why don't I use UI buttons instead, is because I am developing a feature in which the 3-D button changes the material of objects according to the material's assigned to that button, so basically the objects will inherit the buttons' materials stored in array. And my hope is that by gazing on that button, it will change the materials of specific objects.

Thanks in advance.


r/UnityforOculusGo • • Nov 23 '18

Any Oculus Rooms Integration Available?

1 Upvotes

I’ve searched the developer documentation, and I don’t see any mention of how a developer can integrate with Oculus Rooms in anyway. There must be something available as I see some big name apps can at least be launched from Oculus Rooms app.

Can someone point me in the right direction?


r/UnityforOculusGo • • Oct 31 '18

Object goes through the plane

1 Upvotes

Hey,
I have written a script to pick an object with a rigidbody component by the ray casted from the controller and move it around.
I have added this script to pick it up and drop it and have attached it to the objects I want to pick.

  1. using System.Collections;

  2. using System.Collections.Generic;

  3. using UnityEngine;

  4. public class PickUp : PropBase

  5. {

  6. private Rigidbody rb;

  7. void Start()

  8. {

  9.         rb = GetComponent<Rigidbody>();

  10. }

  11. public virtual void Store(Transform NewParent)

  12. {

  13. //The following stops the object being effected by physics while it's in the players hand

  14.         rb.isKinematic = true;

  15. //And fixes it to the new parent it is given by the player script to follow.

  16.         transform.parent = NewParent;

  17. //It then resets it's position and rotation to match it's new parent object

  18. //transform.localRotation = Quaternion.identity;

  19. //transform.localPosition = Vector3.zero;

  20. }

  21. public virtual void Release(Vector3 ThrowDir, float ThrowForce)

  22. {

  23. //On Release the object is made to be effected by physics again.

  24.         rb.isKinematic = false;

  25. //Free itself from following it's parent object

  26.         transform.parent = null;

  27. //And applies a burst of force for one frame to propel itself away from the player.

  28.         rb.AddForce(ThrowDir * ThrowForce, ForceMode.Impulse);

  29. }

  30. }

Problem is that when the object is attached to the controller, it passes through the plane or the floor and does not interact with it any more. It still collides with other objects but not with the plane.
Will be helpful, if anyone can help me fix this.