Unity 3D

gameObject.transform.position = new Vector(0,0,0); //設定一開始位置

if (Input.GetKey(KeyCode.W)) gameObject.transform.position += new Vector3(0, 0, 1) * Time.deltaTime * Speed; //疊加位置 可以移動

LeftShift Space RightShift //KeyCode部分

float = Vector3.Distance(Vector , Vector) //判斷兩者差距多遠 回傳一個float (絕對值)
position = Vector3.Lerp(Vector a, Vector b, float) //取 a + (b-a)*float的值

forward = Vector3(0 , 0 , 1);

Transform.LookAt(target); //看向目標 主要是藉由控制rotation來達到目標

Invoke("class.name" , time); //延遲幾秒進行
Invoke("class.name" , time , deltatime) //延遲幾秒進行並且deltatime循環

playmaker

留言

這個網誌中的熱門文章

無法載入檔案或組件 'System.IO.Compression' 或其相依性的其中之一。

MongoDB 入門

DDD With MVC