I am making a multiplayer game and I am facing a problem. in the prefab, i cannot set object / UI variables, like, completely. And there are a lot of variables and I cannot write for each search by tag or something else. Can anyone tell me how to solve this or an alternative way of the player appearing on the scene without a prefab?
i kinda got the solution, but just to check: is this ok?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Mirror;
public class StatsBank : MonoBehaviour
{
public HpStuff HpS;
public Cursor_building curs;
void Start()
{
GameObject gpl = GameObject.FindGameObjectWithTag("StatsBank");
HpStuff hpl = gpl.GetComponent<HpStuff>();
HpS.HpBar = hpl.HpBar;
HpS.MetallBar = hpl.MetallBar;
HpS.Handle = hpl.Handle;
HpS.InventStuff = hpl.InventStuff;
}
}
