Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Having problems with Rigidbody and collisions with Mirror

Discussion in 'Getting Started' started by Antoner_8, Nov 7, 2023.

  1. Antoner_8

    Antoner_8

    Joined:
    Aug 23, 2022
    Posts:
    10
    The collisions are very strange and they dont work as it is expected. I discovered that the client that is not the server has isKinematic active and when I try to change it, it stays the kinematic. Sorry for my bad english.
     
  2. Antoner_8

    Antoner_8

    Joined:
    Aug 23, 2022
    Posts:
    10
    Im using AddForce impulse
     
  3. Reaktion

    Reaktion

    Joined:
    Nov 8, 2019
    Posts:
    53
    Hi,

    This is because Mirror Network Rigidbody is server-authoritative by default, meaning that you can only interact with physics on the server : collisions will be triggered on the server, and you can only add force to a Rigidbody on the server. (see Network Rigidbody - Mirror (gitbook.io))
    This way, clients Rigidbodies are kinematic, so that they can only move when the server tells them to, and therefore every client will replicate the same physics (coming from the server).
    This is how they are supposed to work, so I don't see the problem. Please share us more about your work / your thoughts ! :)
     
  4. abdemiller

    abdemiller

    Joined:
    Oct 10, 2022
    Posts:
    2
    When encountering issues with Rigidbody and collisions in Unity's Mirror networking framework, it's essential to address several factors. Firstly, ensure that your GameObjects have colliders and Rigidbodies attached. Check the collision layers and make sure they interact as intended. If using triggers, verify that both colliders have the "Is Trigger" property set. Additionally, consider the network synchronization settings for Rigidbodies in Mirror, ensuring that the authoritative server properly handles physics updates. Debugging with print statements or visualizing colliders can help identify the problem areas. When seeking external resources or applications like Remini for photo enhancement, it's crucial to download them from official and secure sources.