UI interactivity

Hello! is there any way i can make a ui button interactable to open brush controller?
25 Replies
mikesky
mikesky•2y 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•2y ago
yes! Unity's default ui and sorry for the double post!
mikesky
mikesky•2y 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•2y 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•2y 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•2y ago
Have you read the dev notes?
UsamaTKD
UsamaTKDOP•2y ago
No! where can i find that? I've found it on your website!!
andybak
andybak•2y 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•2y 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•2y 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•2y ago
ok let me try!! Actually I am new to open brush. can you please tell me where the existing panel is?
andybak
andybak•2y ago
what panel do you want ot add it to? one with some empty space is probably best Tools Panel?
UsamaTKD
UsamaTKDOP•2y ago
yeah! tools panel will be good for this.
andybak
andybak•2y ago
ok so - Prefabs/Panels/ToolPanel (but also ToolPanel_Mobile if you're building for Quest)
UsamaTKD
UsamaTKDOP•2y 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•2y ago
well not just any new script - a new monobehaviour script (i.e. not just a plain C# class)
UsamaTKD
UsamaTKDOP•2y 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•2y ago
Undo is not an ActionButton Check the type of each button Duplicate an ActionButton not an OptionButton
UsamaTKD
UsamaTKDOP•2y ago
oh ok
andybak
andybak•2y ago
No description
andybak
andybak•2y ago
or just grab the prefab:
No description
UsamaTKD
UsamaTKDOP•2y 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•2y 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•2y ago
Nah, can't remember either sorry!
UsamaTKD
UsamaTKDOP•2y ago
Ok thanks! I am trying to find a solution. If i get one, i will tell you.

Did you find this page helpful?