// this is the full error is:
The referenced script on this Behaviour (Game Object ‘weapon holder’) is missing!
// and also:
The referenced script (Scoped) on this Behaviour is missing!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class scope: MonoBehaviour{
public Animator animator;
public GameObject scopeOverlay;
public GameObject weaponCamera;
public Camera mainCamera;
public float scopedFOV = 15f;
private float normalFOV;
public float ScopedSensitivity = 25f;
public bool isScoped = false;
void Update()
{
if (Input.GetButtonDown(“Fire2”))
{
isScoped = !isScoped;
animator.SetBool(“scoped”, isScoped);
if (isScoped)
StartCoroutine(OnScoped());
else
OnUnscoped();
}
}
void OnUnscoped()
{
scopeOverlay.SetActive(false);
weaponCamera.SetActive(true);
mainCamera.fieldOfView = normalFOV;
}
IEnumerator OnScoped()
{
yield return new WaitForSeconds(.15f);
scopeOverlay.SetActive(true);
weaponCamera.SetActive(false);
normalFOV = mainCamera.fieldOfView;
mainCamera.fieldOfView = scopedFOV;
}
}