設置角速度及生成四元數及利用剛體

在對物體的rotation屬性賦值的時候,每每是四元數,因此咱們須要把角度值轉換成四元數 代碼以下: //轉換爲四元數 Vector3 rotationVector3 = new Vector3(0f, 30f, 0f); Quaternion rotation = Quaternion.Euler(rotationVector3); myTransform.rotation = rotation
相關文章
相關標籤/搜索