Changing Camera Background Color
I know there is quite a few questions on this but none of them are helping, I have the script and it just doesn't work.
using UnityEngine;
using System.Collections;
public class CameraBackgroundTest : MonoBehaviour
{
public Color red = Color.red;
Camera cm;
void Start()
{
cm = GetComponent<Camera>();
}
void Update()
{
if (Input.GetKeyUp ("Jump"))
{
cm.backgroundColor = red;
}
}
}
Theres the code. One other thing, the inspector says:
The referenced script on this Behaviour (Game Object 'Main Camera') is missing!
Idk what this means.
Answer by shriya · Aug 10, 2016 at 12:10 PM
Hello,
Make sure your script is attached to the Main Camera. Also your camera property clear flag should be solid color
Hope it helps!!
Thanks, my clear flag wasn't set to a solid color, thanks for the help!
Your answer
Follow this Question
Related Questions
How to script a random asset generator> 0 Answers
Boolean variable is never true, even if declared true or ticked in the inspector 1 Answer
How Do I Adjust Values Over A Gradual Amount of Time ? 4 Answers
Custom Camera Script Toggle Enabled / Disabled 2 Answers
Script able to target two cameras? 0 Answers