Need to add a script so that a character in my project talks when a user clicks on it. Unity is saying I have a parsing error CS8025. here is my script
using UnityEngine;
using System.Collections;
public class HannahVoice : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
var papers : int = 0;
var papersToWin = 5;
var distanceToPaper : float = 2.5;
public var paperPickup : AudioClip;
function Start ()
{
Screen.lockCursor = true;
}
function Update ()
{
if(Input.GetMouseButtonDown (0) || Input.GetKeyDown (KeyCode.E))
{
var ray = Camera.main.ScreenPointToRay(Vector3(Screen.width * 0.5, Screen.height * 0.5, 0.0));
var hit : RaycastHit;
if(Physics.Raycast(ray, hit, distanceToPaper))
{
if(hit.collider.gameObject.name == “Casual_08___Stand”)
{
papers += 1;
GetComponent.().PlayClipAtPoint(paperPickup, transform.position);
}
}
}
}
I am very new to this, any help is vastly appreciated
↧