What error? Post the entire error message (not paraphrasing it like your topic title). And Include the whole script (as this is not everything as there is no class or using statements).
The full error is [22:18:04] NullReferenceException: Object reference not set to an instance of an object Interactions.Start () (at Assets/Scripts/Interactions.cs:17
And the full code is
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Interactions : MonoBehaviour
{
private GameObject blackScreen;
private GameObject paper;
private bool interacting;
private void Start()
{
blackScreen = GameObject.Find("Black Screen");
blackScreen.SetActive(false);
paper = GameObject.Find("Paper");
paper.SetActive(false);
}
public void ReadPapers()
{
if ( interacting )
{
BasicVariables.pausePlayer = false;
Cursor.lockState = CursorLockMode.Locked;
blackScreen.SetActive(false);
paper.SetActive(false);
interacting = false;
}
else
{
BasicVariables.pausePlayer = true;
Cursor.lockState = CursorLockMode.None;
blackScreen.SetActive(true);
paper.SetActive(true);
interacting = true;
}
}
}