I know there are so many questions about this topic but they didn't fix my problem. I'm making a multiplayer game and there can be many client. When First client attended game it is okay but when second client attended the game I'm having this error. How can I fix it? Thank you.
Here is my code:
public GameObject ant;
PlayerMove move;
NetworkManager manager;
void Start()
{
move = ant.GetComponent<PlayerMove>();
manager = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent<NetworkManager>();
}
Here is the PlayerMove script:
public void GeriGit()
{
PlayerRb.AddForce(0, CarpmaKuvveti, 0, ForceMode.Impulse);
StartCoroutine(HizSifirla());
}
these codes are not working when i get the error And here is the error lines:
private void OnTriggerEnter(Collider other)
{
if (other !=null && other.tag !=null)//I tried this code to fix it but it didn't work for me.
{
if (other.tag == "taban")
{
move.GeriGit();
}
}
}