- Home /
 
้้้้i want to fixed movement in cube
i want to insert code for fix movement object object received input movement 1 step by 1 getkey
so object it move to point let get key again but i don't know how do it i need object move like table 

using UnityEngine; using System.Collections;
public class ballcontrol : MonoBehaviour {
 void Update ()
 {
     if (Input.GetKey("up"))
         transform.Rotate (new Vector3 (2, 0, 0), Space.World);
     if (Input.GetKey("down"))
         transform.Rotate (new Vector3 (-2, 0, 0), Space.World);
     if (Input.GetKey("left"))
         transform.Rotate (new Vector3 (0, 0, -2), Space.World);
     if (Input.GetKey("right"))
         transform.Rotate (new Vector3 (0, 0, 2), Space.World);
 }
 
 
               }
 
                 
                untitled.jpg 
                (21.3 kB) 
               
 
                
                 
                1.png 
                (6.4 kB) 
               
 
              
               Comment
              
 
               
              See my answer here:
http://answers.unity3d.com/questions/610359/how-to-roll-a-cube.html
Well, if you will only take a C# solution, that leaves my answer out. I converted my answer to a comment.
Your answer