Hello, I´m trying to make a menu for android and I´m trying to get a ray from a touch to tell me if the button is touched, but I get the ERROR CS0199 in the first line I´ll point out and the other another ERROR CS0199 in the second plus the other 2 errors. Since I´m translating from .js to .cs I guess I´ve ,missed something in the process. I´m not an expert in the programing field, so any help is very much apreciated. Thanks for the help in advanced.

This are the error codes I get:

  1. Assets/Test/ScriptsTest/MenuControl.cs(15,51): error CS0119: Expression denotes a method group', where a variable’, value' or type’ was expected
  2. Assets/Test/ScriptsTest/MenuControl.cs(19,44): error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected
  3. Assets/Test/ScriptsTest/MenuControl.cs(19,36): error CS1502: The best overloaded method match for `UnityEngine.Physics.Raycast(UnityEngine.Vector3, UnityEngine.Vector3, float)’ has some invalid arguments
  4. Assets/Test/ScriptsTest/MenuControl.cs(19,36): error CS1503: Argument #1' cannot convert object’ expression to type `UnityEngine.Vector3’

And here is my code:

using UnityEngine;
using System.Collections;

public class MenuControl : MonoBehaviour {

public GameObject videosButton;

public GameObject optionsButton;

public GameObject exitButton;

// Update is called once per frame
void Update () {

	if (Input.touchCount > 0 && Input.GetTouch.phase == TouchPhase.Began) { /*<== 1st Error */
		RaycastHit hit;

		if(Physics.Raycast(Ray, out hit, 100f)){ /* <== other 3 Errors */

			GameObject buttonTouched = hit.transform.gameObject;

			if(buttonTouched.tag == "Videos"){


			if(buttonTouched.tag == "Options"){


			if(buttonTouched.tag == "Exit"){


			if(buttonTouched.tag != "Videos" && buttonTouched.tag != "Options" && buttonTouched.tag != "Exit"){






You have make an instance of Ray. Ray is a class and classes must be instantiated before use.

Ray ray = new Ray (some Variables)