Hi, I’m trying to call a variable from another script, this variable is inside of a namespace., so I’m having trouble to archieve this.
THE SCRIPT TRYING TO ACCESS THE VARIABLE:
using System;
using UnityEngine;
[RequireComponent(typeof(UnityFunction.Class_One))]
public class Class_Two : MonoBehaviour
{
private UnityFunction.Class_One the_other_var;
public string the_string;
void Start()
{
the_other_var = GetComponent<Tractor_Speed> ();
}
void Update()
{
the_string = the_other_var.the_var;
}
}
THE SCRIPT WITH THE VARIABLE:
using System;
using UnityEngine;
namespace UnityFunction
{
public class Class_One : MonoBehaviour
{
public string the_var;
void Start()
{
the_var = "Hi";
}
}
}