Hey guys I have this old script from a year or two ago that I came back to to move from a Dell to a Mac. It seems to have moved well expect giving me a Assets/Code/TorchLight.cs(9,5): error CS0246: The type or namespace name ‘Light2D’ could not be found (are you missing a using directive or an assembly reference?). I have no idea how to fix this, need help
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
public class TorchLight : MonoBehaviour
{
Light2D fireLight;
float lightInt;
public float minInt = 0.7f, maxInt = 1f;
public bool playerLight;
void Start()
{
FireLight = GetComponent<Light2D>();
InvokeRepeating("DimLight", 2f, 2f);
}
void Update()
{
lightInt = UnityEngine.Random.Range(minInt, maxInt);
FireLight.intensity = lightInt;
}
void DimLight()
{
if (playerLight == true)
{
if (minInt > 0.25f)
{
minInt = minInt - 0.01f;
maxInt = maxInt - 0.01f;
}
}
}
void OnTriggerEnter2D(Collider2D other)
{
if (playerLight == true)
{
if (maxInt < 1)
{
if (other.gameObject.tag == "TorchLight")
{
minInt = minInt + 0.5f;
maxInt = maxInt + 0.5f;
}
}
}
}
}