unity background camera change

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    public Color color1 = Color.red;
    public Color color2 = Color.blue;
    public float duration = 3.0F;

    public Camera cam;

    void Start()
    {
        
    }

    void Update()
    {
        float t = Mathf.PingPong(Time.time, duration) / duration;
        cam.backgroundColor = Color.Lerp(color1, color2, t);
    }
}

4.25
8

                                    using UnityEngine;
using System.Collections;

public class Myclass: MonoBehaviour
{
    public Color Red = Color.red;
    
    public Camera cam;

    void Start()
    {
      
      
    }

    void Update()
    {
      
        cam.backgroundColor = Red;
    }
}

4.25 (8 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
unity camera background coloe camera set color unity change camera background unity 3d i cant see camera color unity how to change camera background unity unity change camera background color urp unity change background unity change the background unity background change unity how to make camera background change colour over time? unity camera color tracker unity get a color from real camera unity get a color from camera unity sget a color from camera making camera change color unity unity change camera background color script unity camera color how to change the backround color in a script unity ar camera change background color unity controll camera bg color via script change solid color camera unity change camera color unity unity change camera background color code unity change main camera color how to change color of camera background scritping unity change camera color unity change camera background unity change camera background by script makes it white how to change unity game background color change camera position unity how to have colour effects on camera unity background color of camera unity unity change background colour unity change camera background color turning white c# unity background color unity camera backgroundColor give detail to a solid color camera unity how to tween camera background color unity Camera environment background type unity background type unity unity 2d how to change camera background color unity main camera background color camera.main.bacgroundcolor unity camera background adds color to images camera backgorund color change unity code change camera background type Unity 2d change camera background color change the color of camera background unity scruot change background color unity camera change background color unity camera background color is red underline unity camera bavkgound cam.background color not changing in script unity unity set camera background in sript unity change camera background color unity set camera background color unity change background color trough script camera color unity unity background camera chnage unity background camera change
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source