I have no clue why this isnt working. ive seen it like tthis in manuals and videos. Please help. Probably a rookie mistake but whatever, im at a loss.
using UnityEngine;
using System.Collections;
public class MouseBehaviour : MonoBehaviour {
GameObject ArrowPrefab;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if(Physics.Raycast(ray, out hit, 100)){
Instantiate(ArrowPrefab, hit, Quaternion (0, 5, 0));
Debug.DrawLine(ray.origin, hit.point, Color.blue);
}
}
}
Assets/MouseBehaviour.cs(20,48): error CS0119: Expression denotes a type', where a
variable’, value' or
method group’ was expected
Assets/MouseBehaviour.cs(20,17): error CS1502: The best overloaded method match for `UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)’ has some invalid arguments
Assets/MouseBehaviour.cs(20,17): error CS1503: Argument #2' cannot convert
UnityEngine.RaycastHit’ expression to type `UnityEngine.Vector3’