Hello,
I am scripting spawning meteors every x seconds in a random range in front of player, i am getting errors tough, also this only spawns one meteor, i would like to spawn more meteors as time passes, i think about adding multiple timers for spawning, or maybe play with spawn method to create more than one meteor.
I would appreciate any help to fix errors and also some way to achieve multiple spawning meteors.
Thanks in advance.
Errors are :
1- 13,12 unexpectedsymbol void
2- 27,23 unexpectedsymbol private
3- 27,23 unexpectedsymbol private
4- 27,23 unexpectedsymbol private
5- 30,134 unexpectedsymbol quaternion
using UnityEngine;
using System.Collections;
public class Meteorbomb : MonoBehaviour {
public Transform prefab;
public float myTimer = 15.0
// Update is called once per frame
void Update () {
if(myTimer > 0){
myTimer -= Time.deltaTime;
}
if(myTimer <= 0){
Spawn () ;
mytimer = 15 ;}
}
void Spawn(){
private int x1 = Random.Range(-6.0F, 13.0F);
private int y1 = Random.Range(-3.0F, 8.0F);
private int z1 = Random.Range( 8.0F, 26.0F);
Instantiate (prefab, new Vector3 (transform.position.x+x1, transform.position.y+y1,Transform.position.z+z1) Quaternion.Euler (270,0,0));
}
}