Storing References to GameObjects

Hello,

I’m trying to store references to game objects in a script, but when I reference the .gameObject I get the holder rather than the original script.

For Example:

in gameController I have a reference to the castleCamera game object.

if I do castleCamera.camera it says gameController does not have a camera, but I’m actually trying to access the camera attached to the original game object castleCamera.

I’m confused with this one… can somebody shed some light on this?

instead of .camera, try castleCamera.GetComponent();

I think .camera is a shortcut method to something else. Oh, and by the way, this should be in the scripting forum, not iOS.