Hi am new to unity3D. Ama developing a mini game using unity3d with javascript. Can anybody tell how to increase speed of object automatically while moving on path.
Javascript code for my object:
function Update () { if (selectedId==GetInstanceID()) { if (Input.GetKey (KeyCode.RightArrow)) transform.Translate (Vector3(0,0,1) * Time.deltaTime*speed); if (Input.GetKey (KeyCode.LeftArrow)) transform.Translate (Vector3(0,0,-1) * Time.deltaTime*speed); if (Input.GetKey (KeyCode.UpArrow)) transform.Translate (Vector3(-1,0,0) * Time.deltaTime*speed); if (Input.GetKey (KeyCode.DownArrow)) transform.Translate (Vector3(1,0,0) * Time.deltaTime*speed); } }