//Jimmy Vegas Unity Tutorial //This script will start quest002 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Quest002Start : MonoBehaviour { public float TheDistance; public GameObject ActionDisplay; public GameObject ActionText; void Start () { } void Update () { TheDistance = PlayerCasting.DistanceFromTarget; } void OnMouseOver() { if (TheDistance <= 3) { ActionText.GetComponent().text = "Open Gate"; AttackBlocker.BlockSword = 1; ActionDisplay.SetActive(true); ActionText.SetActive(true); } if (Input.GetButtonDown("Action")) { if (TheDistance <= 3) { AttackBlocker.BlockSword = 2; Screen.lockCursor = false; Cursor.visible = true; ActionDisplay.SetActive(false); ActionText.SetActive(false); } } } void OnMouseExit() { AttackBlocker.BlockSword = 0; ActionDisplay.SetActive(false); ActionText.SetActive(false); } }