Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums will be revoked at the discretion of Oculus staff.
New to the forums? Click here to read the How To guide. -- Developers click here.

GearVR Line Renderer

bordy131bordy131 Posts: 2
NerveGear
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript1 : MonoBehaviour {

    // Use this for initialization
    private Transform childObject;
    private ParticleSystem objectParticles;
    private LineRenderer objectLineRenderer;
    void Start () {
        childObject = gameObject.transform.Find("EventHohl");
        objectLineRenderer = childObject.GetComponent<LineRenderer>();
    }
	
	// Update is called once per frame
	void Update () {
        if (OVRInput.Get(OVRInput.Button.Two));
            objectLineRenderer.enabled = false;

    }
}


I'm making VR video player with controls based on gearvr controller and I want to add function that will remove line renderer(because it disturbs when you watch video) and turn it back on touchpad click, or swipe up/down, idk. I tried to do this, but it couldn't work, upper you can see my code. EventHohl is eventsystem to which I attached linerenderer

Comments

  • imperativityimperativity Posts: 3,587 Valuable Player
    Hi,

    Welcome to the Oculus Developer Forums.

    We released a blog that demonstrates implementing a line rendering for gui interaction in a Unity project and from the provided code and sample, it should be fairly easy modify to achieve the behavior you are seeking.
Sign In or Register to comment.