I want my enemy to shoot every 5 seconds.
How can I do this ?
With use of the docs Gnatty pointed at, in C# :
void Start() {
StartCoroutine( Shoot() );
}
IEnumerator Shoot() {
while( true ) { //create an endless loop, you can also use a boolean here instead of true and switch it to false to stop the shooting
//shooting code here, instantiate etc.
yield return new WaitForSeconds(5);
}
}