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

in my C# program there is an error which I can`t fix. @username

$
0
0
C# program there is an error it says the private field `Blockawn.block` is assigned but is never used. The C# script is below. using System.Collections; using System.Collections.Generic; using UnityEngine; public class BlockSpawn : MonoBehaviour { public GameObject[] Blocks; public Transform BlockSpawnPos; public int BlockCount = 0; public float NewPos; private int randomNum; private float waitTime = 2.0f; private GameObject block; // Use this for initialization void Start () { Block(); } // Update is called once per frame void Update () { } public void Block() { block = Instantiate (Blocks [Random.Range (0, 5)], BlockSpawnPos.position, Quaternion.identity) as GameObject; Vector3 temp = BlockSpawnPos.position; temp.y = 0; temp.x += 5; temp.z = 0; BlockSpawnPos.position = temp; StartCoroutine (wait()); } IEnumerator wait(){ yield return new WaitForSeconds (waitTime); BlockCount += 1; Block (); } }

Viewing all articles
Browse latest Browse all 2891

Latest Images

Trending Articles



Latest Images

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