前提・実現したいこと
画像の赤い点を軸として、大砲のようにオブジェクトを回転させたい。

ソースコード
C#
1public class TaihoRotate : MonoBehaviour 2{ 3 // Start is called before the first frame update 4 void Start() 5 { 6 7 } 8 9 // Update is called once per frame 10 void Update() 11 { 12 transform.RotateAround(new Vector3(0,0,1), new Vector3(0,0,2),5); 13 } 14} 15
試したこと
transformのRotateやRotateAroundなどを使いコードを記述してみたのですが
全くあらぬ方向に回ってしまい、中々思い通りにいきません。
Rotate系を使うのはやめたほうが良いのでしょうか?
使える関数など教えて頂けると幸いです。。
補足情報(FW/ツールのバージョンなど)
Unity 2019.1.0f2
回答3件
あなたの回答
tips
プレビュー

