guys have a look on this link…i wanna make this type of menu in unity but have no idea at all
any help ? how to do this?
As @Cdrandin says, this would need to be done in 3D space. There are a number of technical challenges going on in the video: depth of field, selection indicator, info displays tied to current selection, etc. But the basic concept of rotating the objects in 3D space is relatively simple. Here is a bit of proof-of-concept code. It demonstrates how it could be done in Unity. I’d likely do a ‘real’ system a bit differently. To use:
- Create a new scene
- Add some game object to the scene (placement does not matter). You can use the built-in objects, or any object scaled to around 1 to 2 units in size in world space.
- Tag the game object with ‘Menu’.
- Attach this script to an empty game object.
- Run. Left/Right error keys to cycle the menu.
#pragma strict
var center = Vector3(0,1 ,0);
var radius = 7.0;
var rotateSpeed = 100.0;
private var objects : Transform[];
private var deltaAngle : float;
private var qTo = Quaternion.identity;
function Start() {
transform.position = center;
var gos = GameObject.FindGameObjectsWithTag("Menu");
deltaAngle = 360.0 / gos.Length;
var v = Vector3.back * radius;
for (var i = 0; i < gos.Length; i++) {
gos*.transform.position = transform.position + v;*
_ gos*.transform.parent = transform;_
_ v = Quaternion.AngleAxis(deltaAngle, Vector3.up) * v;_
_ }_
_}*_
function Update() {
* if (Input.GetKeyDown(KeyCode.LeftArrow)) {*
_ qTo = Quaternion.AngleAxis(deltaAngle, Vector3.up) * qTo;
* }*
* if (Input.GetKeyDown(KeyCode.RightArrow)) {*
qTo = Quaternion.AngleAxis(-deltaAngle, Vector3.up) * qTo;_
* }*
_ transform.rotation = Quaternion.RotateTowards(transform.rotation, qTo, Time.deltaTime * rotateSpeed);_
* Debug.Log(qTo.eulerAngles);*
}