I´ve seen a lot of people on the forums with the same problem but none of them have gotten a single answer so i thought i´d start a new topic and hopefully get the answer that a lot of people seem to need.
Info
My game is split-screen so its divided in 2 different cameras in the middle, 1 over the mid and 1 under.
My player 1s UI is working perfectly and looks like this - Imgur: The magic of the Internet
With the script :
#pragma strict
import UnityEngine.UI;
public var Text : Text;
public var Round1A : boolean;
public var Round2A : boolean;
public var Round3A : boolean;
private var gm : GameObject;
private var First: GameObject;
private var Second : GameObject;
private var Third : GameObject;
private var timer : Timer;
function Start ()
{
gm = GameObject.FindGameObjectWithTag("Gamemaster");
First = GameObject.FindGameObjectWithTag("Gui1");
Second = GameObject.FindGameObjectWithTag("Gui2");
Third = GameObject.FindGameObjectWithTag("Gui3");
}
function Update ()
{
// Final Round Times
if(gameObject.tag == "Gui1")
{
Text.text = timer.Timer1A.ToString("Round 1: 0");
}
if(gameObject.tag == "Gui2")
{
Text.text = timer.Timer2A.ToString("Round 2: 0");
}
if(gameObject.tag == "Gui3")
{
Text.text = timer.Timer3A.ToString("Round 3: 0");
}
// Current Timer
if(gameObject.tag == "Timer" && timer.IncreaseT1A == true)
{
Text.text = timer.Timer1A.ToString("Current Round Timer: 0");
}
if(gameObject.tag == "Timer" && timer.IncreaseT2A == true)
{
Text.text = timer.Timer2A.ToString("Current Round Timer: 0");
}
if(gameObject.tag == "Timer" && timer.IncreaseT3A == true)
{
Text.text = timer.Timer3A.ToString("Current Round Timer: 0");
}
// Total Round Times
if(gameObject.tag == "Total")
{
Text.text = timer.TotalTimeA.ToString("Total Round Time: 0");
}
}
But as you also could see on the picture the player 2 “which was falling down all the time” just had a blank canvas with no text like if the script doesnt work.
It has the same script just with its own set of variables.
Do you know this issue?
Canvas 1 Render Camera is set to “Player 1 camera”
&
Canvas 2 Render Camera is set to “Player 2 camera”
So generally the issue is that the text wont show up on player 2s screen!