I am wondering if it is possible to play an AVI and have an invisible button or tapable area in front of it, so the user clicks/activates it and some action happens? Layers maybe? Thanks in advance.
It seems like the person who might know the answer didn’t read the post yet…
Yes. I think you can just use a plane with rendering off, but if not then just slap an invisible texture on. Use Monobehavior onMouseDown to trigger the functionality you want.
You could also just use a button, of course.
I found this question searching for something similar. I have a script drawing a circle from many wedges. I’d like the wedges to interact with the user via monobehavior. I realize that I’d probably have to create meshes rather than using GL.
But what’s the best way to create clickable polygons dynamically?
I was thinking about just making a small wedge in Maya or max, attaching a script, and instantiating a whole bunch of these suckers to approximate a circle. My manager seems to want the circle drawn entirely dynamically. Also, I’m not sure if 128 wedges, each with a script attached and clickable would place a huge burden on a system.
Thanks for any info!
Use the mesh scripting interface to construct the circle, use the constructed mesh as a mesh collider, and use RaycastHit.triangleIndex to see what triangle was clicked. 128 separate wedges wouldn’t be a huge burden, and in fact should run quite well on a halfway modern computer, but naturally a single circle would be a fair bit faster and free up that much CPU for other things, if needed. Also it would be easier to dynamically change the number of wedges if the circle is constructed procedurally as a single mesh.
–Eric