前提・実現したいこと
ここのサイトを参考にしています。
https://www.yukinomori.games/unity-how-to-make-2d-shooting-matome/
シューティングを作成しています。
プレイヤーの表示、移動はできたのですが、
弾が右側に移動してくれません。
スペルミスもみたのですが、コピー&ペーストで対応しました。
どこでつまづいているのでしょうか?
発生している問題・エラーメッセージ
なし
該当のソースコード
cs
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class Bullet : MonoBehaviour 6{ 7 // Start is called before the first frame update 8 void Start() 9 { 10 11 } 12 13 // Update is called once per frame 14 void Update() 15 { 16 transform.Translate(0.03f, 0, 0); // ここで右側に移動させる 17 18 if (transform.position.x > 10.0f) 19 { 20 Destroy(gameObject); 21 } 22 23 } 24} 25
補足情報(FW/ツールのバージョンなど)
Unity Personal 2020.3.26f1
エディタ:Visual Studio 2022 Community
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。