In fishnet (4.3.5R) I am working with different ways to do server authoritative collisions (specifically triggers) in my 2D top down game. While trying to implement my previously offline OnTriggerEnter2D, I have run into a few issues. One which I believe is possibly intended and the other which I think is a bug.
The difference I noticed with the 2D trigger detection (confirming for OnEnter) is that while offline unity events would trigger if either of the colliders were triggers, the NetworkTrigger2D events only trigger when the object itself is a trigger and disregards if the other collider is a trigger. I have not tested if all collision events work like this and this may very well just be part of conserving network usage.
The other issue which I believe is a bug is that the Network Trigger 2D OnEnter (did not test other or Collision2D) when using the TilemapCollider2D Unity component does not ever register the event, but does register the offline version.
There are definitely work arounds I’ll do for both but figured I should post incase maybe I missed some documentation about usage, or since fgg is active here.
A little snippet (gameObject has Tilemap Collider 2D and Network Trigger 2D components)
private void Awake()
{
_networkTrigger = GetComponent<NetworkTrigger2D>();
_networkTrigger.OnEnter += NetworkTriggerEnter2D;
}
private NetworkTrigger2D _networkTrigger;
private void NetworkTriggerEnter2D(Collider2D collision)
{
Debug.Log("Barrier Networked");
}
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log("Barrier Client");
}
Disclaimer: I am new to using Fishnet and game networking overall