Exponential Instantiation
The original ball fires then I click once. one ball. click twice, 2. then four and so on.
public class Reload : MonoBehaviour { public Rigidbody Cannonball; public Transform clip;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
Instantiate(Cannonball, clip.position, clip.rotation);
}
}
}
Why is this happening? Easiest Fix?
Its for a cannon. id like to shoot one cannonball at a time. less of a mess u kno.
Is the Reload script sitting on the object you're trying to instantiate? That would explain why the number of instantiated objects would double.
yep. thanks bud ill put it on the empty transform
Your answer
Follow this Question
Related Questions
I have searched like the whole Internet for this lol (get Value of specific Prefab(clone)) 2 Answers
Stop Infinitely Spawning Object on Javascript 1 Answer
Bacteria/Cell Growth 1 Answer
Why my clone gameobject cannot move? 0 Answers
Making clones of a GameObject but then the original gets destroyed 0 Answers