Trouble accessing scripts (Boo)

Hello,

I’m currently having trouble using the GetComponent function to access scripts.
I currently have three scripts. One called ForcesUmbrella attached to an object in the scene,
another called CameraInfo attached to the Main Camera and the final one called GetInfo
attached to both the camera and the game object.

What I am trying to do is access the GetPosition() function in ForcesUmbrella from CameraInfo
through GetInfo but I keep getting a “NullReferenceException: Object reference not set to an instance of an object” error
so I must be doing something wrong.

If somebody can point me in the right direction I would be more than grateful.

Thank you and here are the scripts:

#### ForcesUmbrella ####
import UnityEngine

class ForcesUmbrella (MonoBehaviour):
	
	def Start ():
		pass
	
	def Update ():
		pass
	
	def GetPosition():
		Debug.Log('It works')
#####################
#### CameraInfo ####
import UnityEngine

class CameraInfo (MonoBehaviour):
	
	public umbInfo as GetInfo
		
	def Start ():
		umbInfo = GetComponent[of GetInfo]()
	
	def Update ():
		umbInfo.GetUmbrella()
##################
#### GetInfo ####
import UnityEngine

class GetInfo (MonoBehaviour):
	
	public umbInfo as ForcesUmbrella

	def Start ():
		umbInfo = GetComponent[of ForcesUmbrella]()
	
	def Update ():
		pass
	
	def GetUmbrella():
		umbInfo.GetPosition()
##############

I don’t use boo, but it seems like your problem is that you are trying to get the component.

So, when you call GetComponent, you will only get the component attached to the current GameObject.

What you want to do is find the correct GameObject first:

http://unity3d.com/support/documentation/ScriptReference/GameObject.Find.html

and then get the script you need from that compnent using GetComponent.

Plus, this seems like a very inefficient way of doing things, why do you need 3 scripts to connect to one another?