Script that adds a projectile to the scene when the player presses the spacebar, and launches it in the direction the player is facing.

using UnityEngine; public class ProjectileLaunch : MonoBehaviour { public GameObject projectilePrefab; public float launchForce = 10f; private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { GameObject go = Instantiate(projectilePrefab, transform.position, Quaternion.identity); Rigidbody…