Accessing method from other script problem.

Hello, I’m new in unity and I’m trying two things, and i can’t do any of those.
I’ve a scene with two cubes, Cube A and Cube B, and two scripts attached respectively, ScriptA and ScriptB, ScriptB is trying to access to ScriptA method called Hello, that displays “Hello World” in the console and moves Cube A into a position when I hit left shift key.

Here are the scripts:

ScriptA:

using UnityEngine;
using System.Collections;

public class ScriptA : MonoBehaviour {
	
	public static void Hello(){
		Debug.Log("Hello World");
		transform.position = new Vector3(0,5,0);
	}
}

ScriptB:

using UnityEngine;
using System.Collections;

public class ScriptB : MonoBehaviour {
	private ScriptA scriptA;
	
	void Start () {
	   scriptA = GetComponent<ScriptA>();
	}
	
	void Update () {
		if(Input.GetKeyDown(KeyCode.LeftShift)){
			scriptA.Hello();	
		}		
	}
}

What is wrong?

Thanks

GetComponent gets a component on the game object ScriptB is on, and since ScriptA is on another game object it won’t find it.

Either make it public and use the inspector to set the reference, or use FindObjectWithType.