Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

GameObjects change color after trigger restarts the level

Discussion in 'Scripting' started by 1UnityUser12, Mar 29, 2015.

  1. 1UnityUser12

    1UnityUser12

    Joined:
    Jul 22, 2013
    Posts:
    4
    This is the script that resets the level:
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class KillScript : MonoBehaviour {
    5.  
    6.     void OnTriggerEnter (Collider player) {
    7.         if (player.tag == "Player") {
    8.             Application.LoadLevel (0);
    9.         }
    10.     }
    11.  
    12. }
    I don't know why but everytime the level restarts the game objects in the game change color
    Before restart:


    After restart:


    There is no script that has anything to do with changing the color, there is the script above, the script that moves the cube and a script that moves the camera along with the cube.
     
  2. JediJaimie

    JediJaimie

    Joined:
    Feb 25, 2015
    Posts:
    10
    Maybe it has something to do with lighting, when your loading level 0. Because its blue still if you can see it.
     
  3. 1UnityUser12

    1UnityUser12

    Joined:
    Jul 22, 2013
    Posts:
    4
    It's not the lighting