Hi all,
I have tried to find the way to do this, and feel like i’m running around in circles.
All I want to do is run the Instantiate, have it repeat it’s action every (between 5-10 secs).
However I seem stuck lol.
I can’t get it to repeat every 5secs continually.
Code:
var thePrefab : GameObject;
function Start () {
InvokeRepeating(“”,0,5);
var instance : GameObject = Instantiate(thePrefab, transform.position, transform.rotation);
}
I’ve tried thePrefab to get it to start repeating. nothing.
I have a destroy script on the Obj clone that gets created on Instantiate, but that only destroys the cloned Obj when it hits the floor.
okay so I got it repeating, the only problem I have with it is the location of where it is repeating from. It will spawn 1 ‘shot’ from the instantiate game obj,
then it will repeat shooting from 0,0,0 for some reason. So if i try to have multiples, I’ll get a couple of ‘shots’ but then it’ll multishot from 0,0,0 throwing my objects everywhere lol.