Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Need help with making a radial image fill when looking at it in VR/Oculus Go

Discussion in 'AR/VR (XR) Discussion' started by SithRuleTwo, Feb 8, 2019.

  1. SithRuleTwo

    SithRuleTwo

    Joined:
    Jun 20, 2018
    Posts:
    5
    Hi all!

    Im very inexperienced with Unity and VR and have almost no experience scripting, but Im getting the hang of it quickly I think.

    Im trying to have an image fill while looking at it, in the long run Id like it to fill and act as a button that starts movement on a set path. Its like the VR game Lands End.

    Ive already managed to get a button to highlight when looking at it. I just cant figure out to get the other image, the circle that will fill, to do the same.

    Any help would be appreciated. Ive been up and down the internet and youtube, but have only been able to make minor steps to where I am now.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    7,592
    First, please don't do that. Go users hate gaze activation. We point with the controller, not with our heads.

    Second, if you must, then there are several ways to go about it. Perhaps easiest is to cast a ray through the center of the view, and see if it hits your image. When it does, increase the fill; when it doesn't, decrease the fill. When you increase it to 1, fire a UnityEvent that causes whatever you want to happen.

    Then when you come to your senses about the user interaction, you can just cast a ray from the controller instead. :p
     
  3. SithRuleTwo

    SithRuleTwo

    Joined:
    Jun 20, 2018
    Posts:
    5
    Thanks for the input. I kind of have to have it via Gaze as its going to be used by multiple people at once, and due to cost, there may not be controllers available to all. I do hope to get the movement smooth and slow enough as to not cause sickness.

    I will try what you suggest. Ill keep reading the manuals as well. Im assuming there is a script out there for the fill if it does hit the image?
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    7,592
    I don't know if you'll find an off-the-shelf script. Just google the things I mentioned, study the code samples given for each of them, and try to put them together. Post in the Getting Started forum if you get stuck.
     
    SithRuleTwo likes this.
  5. SithRuleTwo

    SithRuleTwo

    Joined:
    Jun 20, 2018
    Posts:
    5
    Will do my best. Script is just pure alien to me. Thank you for the help!