Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Error Code CS1519

$
0
0
I am atempting to create a random spawn script. All was working fine, until I recieved this error code: Assets/Scripts/Game/randomSpawn.cs(8,27): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration If anybody could help me out, I would appreciate it! Code: using UnityEngine; using System.Collections; public class randomSpawn : MonoBehaviour { public float amountOfSpawnPoints = 2; public spawnPoint = 0; private static Vector3[] spawnPos = new Vector3[amountOfSpawnPoints]; // Use this for initialization void Start () { spawnPos[0] = Vector3(10,10,10); spawnPos[1] = Vector3(20,20,20); spawnPos[2] = Vector3(30,30,30); SpawnObject(); } // Update is called once per frame void Update () { } public void SpawnObject() { spawnPoint = Random.Range(0, amountOfSpawnPoints - 1); Instantiate(spawnObj, spawnPos[spawnPoint], Quaternion.identity); } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>