Hello,
My script is very simple : once the character stops moving, the camera background will change.
I don't know why, every time I start the Play mode, Unity crashes.
Here's my script (C#) :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cameraBackground : MonoBehaviour {
public Color black = Color.black;
public Camera cam;
public GameObject character;
// Use this for initialization
void Start () {
cam = GetComponent();
}
// Update is called once per frame
void Update () {
while(character.GetComponent().enabled == false){
cam.backgroundColor = black;
}
}
}
Any help would be appreciated.
Thank you and sorry for my English.
↧