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.
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
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:
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.