I’m new to Unity, and attempting to spawn a Firebolt in front of the character. The prefab I have already has the appearance and effect I need, and as soon as the object enters the game it moves forwards. What I am trying to do is have it spawn when I press ‘Q’, and then do what the prefab has already been designed to do.
When I attempt to do so, all it results in is the first firebolt from the original prefab firing perfectly, and the rest just a series of somewhat distant flashes of light. If it’s any help, the prefab is called ‘Firebolt’ from the asset pack ‘Fire and Spell Effects’ from the Unity Asset Store. Here is the code I have so far:
public GameObject leFirebolt;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey(KeyCode.Q)){
Instantiate (leFirebolt, transform.position, transform.rotation);
}
}
}