【Unity】マウスをクリックしたら、弾を発射する方法

public GameObject bullet; // Update is called once per frame void Update () { if(Input.GetMouseButtonDown(0)) { shot(); } } void shot() { Instantiate(bullet, transform.position, transform.rotation); } ちなみに、弾の方のスクリプトは以下。 public int speed = 10; Rigidbody rb; // Use this for initiali…