We need more information. Each time you call Instantiate and you give it a prefab reference it only creates on instance of that prefab, this is true in the product today so if you’re seeing something different then my guess is that either (a) you’re actually calling it repeatedly and just don’t know it, or (b) your prefab is not just a single object but many and you don’t realize that.
Can you show us your code? Can you confirm that the prefab you’re instancing is in fact only one object (manually drag it into your scene, do you only get the one object you expect)?
GetButtonDown will only fire once, even if the user holds down the key/button in question. Please share your code as that will help us help you. For example, the code shown in the script reference entry for Input.GetButtonDown should only generate one instantiated object per press of the “Fire1” button (left mouse), something I can confirm:
// Instantiates a projectile whenever the user hits the Fire1 Button.
var projectile : GameObject;
function Update () {
if (Input.GetButtonDown ("Fire1")) {
clone = Instantiate (projectile, transform.position, transform.rotation);
}
}
And all becomes clear, this is a situation where a bit more careful reading of the docs might have helped you. You’re using Input.GetButton, from the doc page it says:
So, “think auto fire”, and that means unless you are lightning quick you just might get more than one instantiation as it’s a repeating call. Compare that with the code you said you were using in your second post, and that I referenced above, Input.GetButtonDown whose doc page says:
Which is much more of a single-fire per key press, even if it’s held down.
So, be sure you read the docs when having questions like this and in your case switch from GetButton to GetButtonDown and you’ll be all set!
Some times it takes new/fresh eyes to spot remarkably simple stuff… You’re quite welcome, these forums are all about helping each other so I’m glad I could lend a hand. Rock on!