Hi,
I recently started learning how to script/program in C# whereas my background is concept artist/game-design. So bear with me.
The problem i stumbled upon seems rather simple but i can’t put my finger on it.
Assets/Scripts/LearningScript.cs(20,50): error CS1061: Type TalkToMe' does not contain a definition for
hereItIs’ and no extension method hereItIs' of type
TalkToMe’ could be found (are you missing a using directive or an assembly reference?)
I think i’m making a simple naming policy mistake, however its hard knowing exactly what your doing being such a beginner and all.
using UnityEngine;
using System.Collections.Generic;
public class LearningScript : MonoBehaviour
{
TalkToMe otherComponent;
void Start ()
{
otherComponent = GetComponent<TalkToMe>();
Debug.Log ("Press the Return key.");
}
void Update ()
{
if(Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("This is the TalkToMe Component: " + otherComponent);
Debug.Log(otherComponent.hereItIs);
otherComponent.();
}
}
}
using UnityEngine;
using System.Collections;
public class TalkToMe : MonoBehaviour
{
public string hereItiS = "This is the TalkToMe variable";
public void MakeMeTalk ()
{
Debug.Log ("This is the TalkToMe method");
}
}
…Strangely enough i think i saw the mistake whilst hovering over the code again.