c# noob question via /r/learnprogramming


c# noob question

Hi there, am getting an error with my c# code for unity, and was wondering if someone could help me out.

The error messages I'm getting is:
The nameHandsize' does not exist in the current context The nameHand' does not exist in the current context
The name`Hand' does not exist in the current context

And here's the code:

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class CardGame : MonoBehaviour {

public int HandSize = 6; public GameObject CardBack; private GameObject[] hand; private GameObject[] EnemyHand; public GameObject[] MonsterDeck = new GameObject[6]; private int[] MyCards = new int[6]; private int[] EnemyCards = new int[6]; public int CardType; public string CardName; // Use this for initialization void Start () { Hand = new GameObject[Handsize]; for (int x = 0; x < HandSize; x++) { CardType = Random.Range(0,5); GameObject go = GameObject.Instantiate(MonsterDeck[CardType]) as GameObject; Vector3 positionCard = new Vector3((x*4) + 1, 1, 0); go.transform.position = positionCard; Hand[x] = go; } } // Update is called once per frame void Update () { } 

}

Thanks for your help!

Submitted July 09, 2017 at 04:44PM by leyatur
via reddit http://ift.tt/2uFTvHn

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s