#UI didn't show up

1 messages · Page 1 of 1 (latest)

kindred ore
#

Hi there!
I have a problem with winPanel, in unity console I have information that this panel is activated, but nothing shows in game...I checked manually this panel and is not behind any ui. Do you have any suggetstions?

#

I also attached 3 scripts to this post,hope you can see it

crisp fog
#

not seeing any files or anything

#

you can share code via paste sites
!code

wispy gustBOT
kindred ore
crisp fog
#

i see the files now, but you should still use the paste sites above

kindred ore
#

shall I paste just the link?

crisp fog
#

so which log are you saying you're getting?

#

also can you see the panel in scene view?

kindred ore
#

in scene view when i click play and manually enable this panel it normally shows,but after one player win in log I have this
🟢 WinPanel został aktywowany.
UnityEngine.Debug:Log (object)
WinPanel:ShowWinner (string) (at Assets/Script/Game/WinPanel.cs:35)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:248)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)
WinPanel został aktywowany. means WinPanel is activated

crisp fog
#

in that case with someone winning normally, do you see the panel in scene view?

#

perhaps check if anything along the hierarchy is deactivated

kindred ore
#

in scene view or game view? in game view i see nothing but in scene view is ok

crisp fog
#

is it.. not that?

kindred ore
#

this is it, but when i play this game it won't show

crisp fog
#

ah, i thought you were in play mode

#

do you see the winpanel in scene view while in play mode

kindred ore
#

is disabled,but code should enabled it after player win

#

you have here
private void Awake()
{
Debug.Log("✅ WinPanel.Awake – WinPanel obecny w scenie");

    gameObject.SetActive(false); // Ukryj cały panel
}

that on start the panel shall be not active

#

and here is activated
public void ShowWinner(string nickname)
{
Debug.Log($"[WIN PANEL] ShowWinner wywołane dla: {nickname}");

    if (winnerText != null)
    {
        winnerText.text = $"{nickname} Wins!";
    }
    else
    {
        Debug.LogWarning("⚠️ winnerText nie jest przypisany.");
    }

    gameObject.SetActive(true); // Pokaż cały panel
    Debug.Log("🟢 WinPanel został aktywowany.");
#

in addition my uimanager is singleton in the first scene, I made prefab from winpanel object and add to the uimanager

crisp fog
#

could you add this as context to that last log, the 'został aktywowany' one

#

like Debug.Log("...", this);

#

to make sure it's on the right object

kindred ore
#

now in logs you can see it WinPanel zostal aktywowany.this

crisp fog
#

that's not what i said to do

#

pass it as another argument

#

then you can click (or double-click, i don't remember) the log to highlight the object it came from

kindred ore
#

when i double cilcked it opens vs and shows this code
public void ShowWinner(string nickname)
{
Debug.Log($"[WIN PANEL] ShowWinner wywołane dla: {nickname}");

   if (winnerText != null)
   {
       winnerText.text = $"{nickname} Wins!";
   }
   else
   {
       Debug.LogWarning("⚠️ winnerText nie jest przypisany.");
   }

   gameObject.SetActive(true); // Pokaż cały panel
   Debug.Log("🟢 WinPanel został aktywowany.this");
crisp fog
#

yeah because you haven't actually set the context

kindred ore
#

gameObject.SetActive(true); // Pokaż cały panel
Debug.Log("🟢 WinPanel został aktywowany.",this);

#

like this?

crisp fog
#

yes

kindred ore
#

i add it

#

in logs you have who is the winner and that panel is activated
📥 HandleServerMessage RAW: {"type":"game_over","winner":"test2"}
UnityEngine.Debug:Log (object)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:147)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)

🎉 Zwycięzca meczu: test2
UnityEngine.Debug:Log (object)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:247)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)

[WIN PANEL] ShowWinner wywołane dla: test2
UnityEngine.Debug:Log (object)
WinPanel:ShowWinner (string) (at Assets/Script/Game/WinPanel.cs:23)
PlayerInfo:HandleServerMessage (string) (at Assets/Script/Player/PlayerInfo.cs:248)
PlayerInfo:<InitializeConnection>b__24_1 (byte[]) (at Assets/Script/Player/PlayerInfo.cs:94)
NativeWebSocket.WebSocket:DispatchMessageQueue () (at Assets/Plugins/NativeWebSocket/WebSocket.cs:637)
PlayerInfo:Update () (at Assets/Script/Player/PlayerInfo.cs:396)

crisp fog
#

click on the 'został aktywowany' log and see what gameobject it's coming from