Firing a rocket - flight problem

Hey, trying to instiate a rocket, but at the moment, it’s just spawning hundreds and hundreds of rockets without me even pressing the mouse, it nearly crashes unity if I don’t stop playmode.

    using UnityEngine;
using System.Collections;

public class RocketLauncher : MonoBehaviour {

	public GameObject thingToSpawn;
	
	void Update () {
		if(Input.GetKeyDown(KeyCode.Space));
		{
		Instantiate(thingToSpawn, transform.position, transform.rotation);
		}
	}

}

The problem with the flight mode is that I’ve got a small script setup, it banks left and right with ease along the Z axis, and it rotates on the X forwards and backwards, but if I rotate it along the Z 90degreas, it won’t rotate on the X at all.

(Using relative torque.)

You’ve got a semicolon at the end of your if statement, so Unity thinks the statement has ended and then Update() sees this lovely little Instantiate command to run every frame. Simple problems are the hardest to spot!

When you script with GetKeyDown, it means that as long as you press the key, it keeps instantiating.
You have to put an Yield function in order to “pause” the spawning of your rockets.
It also seems that you should apply forces to the rocket in order to make it fly.