Trying to make a small section of code that spawns 3d text objects at certain locations, but I keep getting this error
part of script 1.
DebugTextScript Text = (DebugTextScript)Instantiate(TextBoxToInstantiate, neighbour.worldPosition, Quaternion.identity);
Text.gValue = neighbour.gCost;
Text.hValue = neighbour.hCost;
Text.fValue = neighbour.fCost
;
Debugtextscript:
using UnityEngine;
using System.Collections;
public class DebugTextScript : MonoBehaviour {
public int gValue;
public int hValue;
public int fValue;
public GameObject Textbox;
public DebugTextScript( int _gValue, int _hValue, int _fValue)
{
gValue = _gValue;
hValue = _hValue;
fValue = _fValue;
//ThisText.text = gValue.ToString() + "
" + hValue.ToString() + "
" + fValue;
}