trying to make it so when i hit “D” in game it shoots a bullet. I keep getting an error that says “An embedded statement may not be a declaration or labeled statement” here is my script:
using UnityEngine;
using System.Collections;
public class Creator : MonoBehaviour {
public Rigidbody ThePrefab;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetKey(KeyCode.D))
Rigidbody instance;
instance = Instantiate(thePrefab,transform.position, transform.rotation);
}