Search Unity

Scripts for Virtual Buttons

Discussion in 'AR/VR (XR) Discussion' started by Rkitekt01, Mar 3, 2019.

  1. Rkitekt01

    Rkitekt01

    Joined:
    Feb 6, 2019
    Posts:
    2
    Hi Team,

    I'm going through some Udemy lessons on creating an AR app through which I can view models I built off several sketches. I've gotten as far as getting the buttons set for the individual targets but I can't really figure out how to edit the script I have to keep the model visible after pressing the button and releasing. I've never messed with C# before and this is the first project I've managed in Unity that's worth anything lol

    If anyone has any tips I'm all ears. I'll post screenshots of what I see in my phone screen and the script. The script below is set to turn the model off when it's released, so I'm looking for advice on how to keep it active until I press the button again - kinda like a light switch. Setting a 3rd "OnButton" option seems to break it. Do I need another variable or something? My coding skills are pretty beginner at best.

    Thanks,

    T.
     

    Attached Files: