UI interactivity

Hello! is there any way i can make a ui button interactable to open brush controller?
25 Replies
mikesky
mikesky•17mo ago
Hey! First off, I assume you mean the Default unity UI components? (also, please don't double post! you had the right channel 🙂 )
UsamaTKD
UsamaTKDOP•17mo ago
yes! Unity's default ui and sorry for the double post!
mikesky
mikesky•17mo ago
Tilt/Open Brush's UI system is heavily opinionated, I'm not sure how easy this would be. Have you considered making your own open brush-style panel? ( @andybak might know more here)
andybak
andybak•17mo ago
Is this a button you're using from VR? I'd strongly recommend using Open Brush UI components for all VR UI
UsamaTKD
UsamaTKDOP•17mo ago
i can use open brush's UI system if it is easy to use. I just want a ui button to just enable a gameobject. Can you please tell me how to do that?
andybak
andybak•17mo ago
Have you read the dev notes?
UsamaTKD
UsamaTKDOP•17mo ago
No! where can i find that? I've found it on your website!!
andybak
andybak•17mo ago
cool. 🙂 It's not amazing - but it's a good place to start. and there's a fair bit about UI stuff is this a button on an existing panel - or do you need a new panel as well?
UsamaTKD
UsamaTKDOP•17mo ago
I can use an existing panel or can create a new one! my main task is just to add a UI button!! I hope you are getting my point!
andybak
andybak•17mo ago
In that cae - add it to an existing panel. That's easiest 1. Create a new monobehaviour with a single method that does what you want 2. Add a new ActionButton to a panel (copy an existing one) 3. Add your new monobehaviour to the button 4. connect the UnityEvent on the button to your new monobehaviour
UsamaTKD
UsamaTKDOP•17mo ago
ok let me try!! Actually I am new to open brush. can you please tell me where the existing panel is?
andybak
andybak•17mo ago
what panel do you want ot add it to? one with some empty space is probably best Tools Panel?
UsamaTKD
UsamaTKDOP•17mo ago
yeah! tools panel will be good for this.
andybak
andybak•17mo ago
ok so - Prefabs/Panels/ToolPanel (but also ToolPanel_Mobile if you're building for Quest)
UsamaTKD
UsamaTKDOP•17mo ago
ok thanks! let me see! Hey guys! I just want to confirm one thing, by creating monobehaviour, you mean to create new script right?
andybak
andybak•17mo ago
well not just any new script - a new monobehaviour script (i.e. not just a plain C# class)
UsamaTKD
UsamaTKDOP•17mo ago
oh I got it Actually i was a bit confused about the steps you told me yesterday SO i have duplicated a UI button(I've duplicated undo button) from the tools panel. Can you explain the fourth point where you say: connect the UnityEvent on the button to your new monobehaviour
andybak
andybak•17mo ago
Undo is not an ActionButton Check the type of each button Duplicate an ActionButton not an OptionButton
UsamaTKD
UsamaTKDOP•17mo ago
oh ok
andybak
andybak•17mo ago
No description
andybak
andybak•17mo ago
or just grab the prefab:
No description
UsamaTKD
UsamaTKDOP•17mo ago
It is working fine!! You guys are amazing!! Thank you!!!!!!! actually i do have one more problem😅 What i have found is, your open brush xr rig should be enabled in the start of the app, otherwise, it behaves wierd(correct me if i am wrong). actually I am using two different vr systems in one project i.e open brush and VRIF. I want VRIF rig in the start of the scene means when i start the project, the first xr rig should be vrif's and then after pressing a UI button, it should switch to open brush(enabling open brush and disabling vrif).
andybak
andybak•17mo ago
There was a project on github that turned Open Brush into one huge prefab and instantiated it when needed. Can't remember the name. @mikesky ? That might predate the new XR plugin system though. I've never tried to do anything like this so I don't know much that will help.
mikesky
mikesky•17mo ago
Nah, can't remember either sorry!
UsamaTKD
UsamaTKDOP•17mo ago
Ok thanks! I am trying to find a solution. If i get one, i will tell you.
Want results from more Discord servers?
Add your server