出現させたObjectを回転させたくて下記のスクリプトを書いてみたのですが回転しません。
何処を訂正すれば良いのか教えてください。
...
using UnityEngine;
using System.Collections;
public class Stage : MonoBehaviour {
public GameObject CristalPrefab;
// Use this for initialization void Start () { obj = CristalPrefab; } // Update is called once per frame void Update () { } void OnGUI() { float sizeX = 200; float sizeY = 30; float x=Screen.width / 2 + sizeX * 2; float y = Screen.height / 2 + sizeY * 3; if(GUI.Button(new Rect(x, y + sizeY * 4, sizeX, sizeY), "スタート")) { Instantiate(CristalPrefab, new Vector3(0, 0, 0), Quaternion.identity); transform.Rotate(new Vector3(0, 1, 0)); } }
}
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/12/11 04:26
退会済みユーザー
2017/12/11 04:40 編集
退会済みユーザー
2017/12/11 05:06
2017/12/11 05:07
2017/12/11 05:08
2017/12/11 08:14
2017/12/11 08:41
退会済みユーザー
2017/12/11 08:55
2017/12/11 09:24