Hey unity community!,
like it’s written in the title, I’m currently trying to network collectibles in my game. So I’m rookie, here’s my code and I need help thanks!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class pickup : MonoBehaviour {
void OnTriggerEnter(Collider collision)
{
Debug.Log(collision.gameObject.tag);
if(collision.gameObject.tag == "Player")
{
Debug.Log(gameObject);
Network.Destroy(gameObject);
}
}
}
So when one player take a collectible I want it to be destroyed in the other player screen too.
Thanks!