Scripts Comunication error with string

Hi Guys, believe that i try to search but i couldn’t get right way.
Is this,
I have a object with name bt_UpArrow, with a GUI texture component, with this script:

public class GUI_Arrow_Up : MonoBehaviour {

	public Cam_CTRL new_Cam_CTRL;
	
	public static string ArrowKey_GLOBAL;
	
	void OnMouseEnter() 
	{		
		new_Cam_CTRL = GameObject.Find ("Camera_CTRL").AddComponent<Cam_CTRL>();
		ArrowKey_GLOBAL = "Up_Arrow";
    }
	
	void OnMouseExit()		
	{
		Destroy(new_Cam_CTRL);
	}
	
}

This, add a component with movement to the object Camera_CTRL, that have this script:

public class Cam_CTRL : MonoBehaviour {	
	
	public float turnSpeed = 50f;
	
	public static string ArrowKey_GLOBAL;
	
	private GUI_Arrow_Up new_GUI_Arrow_Up;
	
	private string new_ArrowKey_GLOBAL;
	
	void Awake()	
	{
		//  I NEED THIS ??? ///new_GUI_Arrow_Up = GetComponent<GUI_Arrow_Up>();			
		// PROBLEM //  new_Message = GameObject.Find ("bt_UpArrow").GetComponent<GUI_Arrow_Up>().Mensagem;		
	}

	void Update () {
		
		if(ArrowKey_GLOBAL == "UpArrow")
		{
			transform.Rotate(Vector3.left, -turnSpeed * Time.deltaTime);
		}
	}
}

To place the component in the object to move, ok.
To transfer the string global and use as variable for different movements,i couldn’t.

can you help me :face_with_spiral_eyes: thanks :wink:

Maybe

void OnMouseEnter()
    {      
        new_Cam_CTRL = GameObject.Find ("Camera_CTRL").AddComponent<Cam_CTRL>();
        new_Cam_CTRL.ArrowKey_GLOBAL = "Up_Arrow";
    }

instead of

void OnMouseEnter()
    {      
        new_Cam_CTRL = GameObject.Find ("Camera_CTRL").AddComponent<Cam_CTRL>();
        ArrowKey_GLOBAL = "Up_Arrow";
    }

I Patico, thanks, my problem is call the string from the Cam_CTRL script. Your suggestion give an error and i think that part is ok, but thanks :wink:

My problem is bring the

public class Cam_CTRL : MonoBehaviour {	
	
	public float turnSpeed = 50f;
	
	public static string ArrowKey_GLOBAL;
	
	private GUI_Arrow_Up new_GUI_Arrow_Up;
	
	private string new_ArrowKey_GLOBAL;
	
	void Awake()	
	{
		//new_GUI_Arrow_Up = GetComponent<GUI_Arrow_Up>();			
		//new_ArrowKey_GLOBAL = GameObject.Find ("bt_UpArrow").GetComponent<GUI_Arrow_Up>().ArrowKey_GLOBAL;		
	}

	void Update () {
		
		if(ArrowKey_GLOBAL == "UpArrow")
		{
			transform.Rotate(Vector3.left, -turnSpeed * Time.deltaTime);
		}
	
	}
}

Someone help me please, :slight_smile:

My problem is bring the Global string , to this script …