I’m New in unity3d and game development also. i just start to make game runnig style like temmple run. i add a cube in scene and assign this script for movement
function Update () {
transform.Translate (transform.forward * 2.0f * Time.deltaTime);
if (Input.GetKey ("up")) {
transform.Rotate (Vector3.up * 90.0f ); ;
}
}
when i play cube moving correctly. but when press up button the cube not rotate 90 degree but just move forward and backward.