Hello,
I'd like to have some documentation about how to use the new NetworkCollider/NetworkTrigger components.
I've tried to use them on my project, without success.
I have added the NetworkTrigger component to a projectile and used the code as is but doesn't work :
public class MyClass : NetworkBehaviour
{
private NetworkTrigger2D _networkTrigger2D;
public override void OnStartNetwork()
{
base.OnStartNetwork();
_networkTrigger2D = GetComponent<NetworkTrigger2D>();
_networkTrigger2D.OnEnter += OnEnter;
}
public void OnEnter(Collider2D other)
{
Debug.Log("Collision");
}
}
Did I miss something ?