problem in accessing another script component

hi am doing a fps game using Eteeski’s tutorials.
my problem is am doing it in c# .the logic of the script is that am accessing a line of code named as “currentyrotation” from another script, and there is a declaration problem in the script.

transform.rotation = Quaternion.Euler(0,cameraobject.GetComponent(“mouselookup_script”).currentyrotation,0);

the error message i get when compiling this code is

Assets/scripts/playermovement_script.cs(17,49): error CS1502: The best overloaded method match for `UnityEngine.Quaternion.Euler(float, float, float)’ has some invalid arguments

how to write this line of code in c#.

i am even attaching the scripts.

need help…

1117263–42131–$mouselookup_script.cs (885 Bytes)
1117263–42132–$playermovement_script.cs (395 Bytes)

There are two problems here.
Firstly, in C# the return value of GetComponent() is of type Component. To do what you want you need to use the generic version of GetComponent so it returns the correct type:

	transform.rotation = Quaternion.Euler(0,cameraobject.GetComponent<mouselookup_script>().currentyrotation,0);

Secondly, the field currentyrotation is private. If you want to access it outside that script you need to make it public:

	public float currentyrotation;

thank you gibbonator, i got it corrected, but when i declare the currentyRotation variable as public it shows up in the inspector view.is there any way of hiding it from inspector like @HideInInspector command in javascript.

thanks once again for ur help.its working now.

// c# version of @HideInInspector
[HideInInspector]
public float currentyRotation;