the code im trying to add to a plane (the object) is:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Colourobjectkey : MonoBehaviour
{
public Material matofobject;
public Color newcol;
public KeyCode changecolo;
public Colourobjectkey()
{
}
// Use this for initialization
void Start()
{
matofobject.color = Color.black;
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(changecolo))
{
if (matofobject.color == Color.black)
{
matofobject.color = newcol;
}
else;
{
matofobject.color = Color.black;
}
}
}
}
}
and it wont work please help someone. (btw it says: ‘Can’t add script behaviour VisualContainerAsset. The script needs to derive from MonoBehavour !’ whenever i try to do it lol im probably being an idiot rn)