So I was working on a different script when this error popped up, I didn't even save the script and the error popped up. I am trying to figure out why it is wrong because it worked before and everyone else's is working fine. Here is the script with the error
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityStandardAssets.Characters.FirstPerson {
public class PhoneSystem : MonoBehaviour {
public GameObject phonePickedUp;
public GameObject phoneCanvas;
public bool phoneUp = false;
public GameObject player;
// Update is called once per frame
void Update() {
if (Input.GetKeyDown(KeyCode.E))
{
if (phonePickedUp.GetComponent().phone == true)
{
if (phoneUp == false)
{
Time.timeScale = 0;
phoneCanvas.SetActive(true);
player.GetComponent().PlayerStop();
phoneUp = true;
} else
{
Time.timeScale = 1;
phoneCanvas.SetActive(false);
phoneUp = false;
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
}
}
}
}
}
↧