Okay I did fiddling with it all day until 2:21AM I think I have it but I’m missing something.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Tree.Dialogue
{
public class DreamersConvert : MonoBehaviour
{
[SerializeField] Dialogue script = null;
[SerializeField] bool isPlayer = false;
#region Triggers
void OnTriggerEnter2D(Collider2D other)
{
if(other.tag == "Player")
{
isPlayer = true;
Debug.Log("Hello Player");
}
}
void OnTriggerExit2D(Collider2D other)
{
if(other.tag == "Player")
{
isPlayer = false;
Debug.Log("Goodbye Player");
}
}
#endregion
void PlayerTalking()
{
if(script == null)
{
return;
}
if (Input.GetButtonDown("Interactive") && isPlayer)
{
Debug.Log("We got it Tim.");
GetComponent<PlayersConversant>.StartDialoge(script);
}
return;
}
}
}
That’s my code right now I know it has something to do with the GetComponent but I don’t know what I could call to fix it. To explain what I did I took out the Awake code since I think that was what’s throwing the null but I’m just trying to figure what to put in front of the Get component before I can fully test it all.