Assets/IgakuriGenerator.cs(15,31): error CS1525: Unexpected symbol `igaguri'
とエラーが出ました。
using UnityEngine; using System.Collections; public class IgakuriGenerator : MonoBehaviour { public GameObject igaguriPrefab; // Update is called once per frame void Update () { if (Input.GetMouseButtonDown (0)) { GameObject igaguri = Instantiate (igaguriPrefab) as GameObject; Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition); Vector3 worldDir = ray.direction igaguri.GetComponent<IgakuriController> ().Shoot (worldDir.normalized * 2000); } } }
と書いた部分の
igaguri.GetComponent<IgakuriController> ().Shoot (worldDir.normalized * 2000);
の部分なのですが
GameObject igaguri = Instantiate (igaguriPrefab) as GameObject;
と変数igaguriを定義しているのにどうしてこのようなエラーが出るのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。