- Home /
How to do this GUI
Hello Geniuses out here!
I'm new with unity but kind a in hurry to learn so i can pitch on a big job! Im pushing my luck here, If some one can suggest a script for a GUI which do something like this : http://vimeo.com/32607585
(i animate that for reference)
and its gonna be touch input in windows 7 output to 30" LCD TV with NExtWindows Touchscreen Overlay.
Cool GUI. :) I have to wonder what you mean by "suggest a script", though... If you mean "write me a script that does that", it's no good. That's the fastest way to earn people's ire around here. If you mean "offer suggestions on how I can implement this myself", then you've come to the right place. :)
First of all, the selectable elements look like thin boxes to me. So make thin boxes, and either try to play with how to create a texture that wraps around it in such a manner that the sides turn blue and the front displays the desired content, OR maybe create a plane the same size as the front of the box, make a child of the box so it shares the box's rotations, and then texture the plane with the content ins$$anonymous$$d. That would probably be easier.
Then, study the various rotations available in the Quaternion and Transform class. There are tons of them, many of them useful to your scenario. What you want to do isn't particularly mathematically difficult: You just want to rotate a collection of your boxes an equal amount of degrees around a shared axis, probably Vector3.up. Transform.RotateAround (http://unity3d.com/support/documentation/ScriptReference/Transform.RotateAround.html) does that, for example.
When you've got that working, you can start looking into raycasting to get them actually selectable, but that should probably be in a separate question...
Again, sorry to disappoint you if you were hoping for a finished solution.
thanks.. CHPedersen.. thats what i meant.. someone to point a direction so i can do it my self..
right now what i did is, model all things in c4d, bake and import it. $$anonymous$$ake 1 parent and put all the blueboxes in that parent. make that parent rigid body and put drag rigid body in it. yes it's rotated when i drag it :)
so i guess i have to look into ray casting isnt it?
Answer by qinghill · Nov 25, 2011 at 09:03 AM
I manage to rotate that ring, but how do i click each of the buttons inside that rigidbody? urmmmmmmm
Answer by ks13 · Nov 25, 2011 at 09:18 AM
Try Physics.Raycast and RaycastHit...coupled with Input.touches, should be what you're looking for.
Ok. You use Raycast to trace a ray from a touch or all the touches towards the back. If the ray touches an object, Raycasthit returns which object is hit. You get the name of the object or any other parameter that helps you identify the choice made by user. Then you act upon the choice.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Setting Scroll View Width GUILayout 1 Answer
Destroy a Game object on collision and add it to my Gui??? 1 Answer
PasswordField help. 1 Answer
Two Unity GUI questions 2 Answers