'Camera' does not contain a definition for 'ScreenPointToRay'

Hi, I want to make my player face the mouse pointer. (Twin stick shooter like)
After some failed tries, I googled, found this.

Now I “translated” it to C#, but I always get the error ‘Camera’ does not contain a definition for ‘ScreenPointToRay’

Code: Ray myRay = Cam.ScreenPointToRay(Input.mousePosition); // cam is defined as "public Camera cam;" and a camera is assigned in unity

Why is that? How can I fix it?

Any chance you named one of your scripts ‘Camera’? If so, your script is overriding Unity’s Camera class.

Thanks : I had the same issue and your advice helped. Just renamed script from Camera to CameraControl.