com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

NetworkRigidBody2D changes the RigidBody2D body-type to kinematic for the server when NetworkTransform is attached.

Open yousefkmail opened this issue 1 year ago • 1 comments

Description

when u have a Rigidbody2D attached to a gameobject, having NetworkRigidbody2D shouldn't mess with the body type of the Rigidbody2D on the server, however, that does happen. no matter what body type the component have, it always goes to kinematic.

How to reproduce :

1- Create a new project 2- Download Netcode for gameobjects 1.9.1 3- add NetworkManager to the scene. 4- have an object with the following components. a- NetworkObject b- NetworkTransform c- Rigidbody2D d- NetworkRigidbody2D 5- set the RigidBody2D body type to Dynamic 6- start the game as host.

when the game starts, the body type should be the same for the server, however it changes to kinematic no matter what it was, dynamic or static.

Screenshots

Before entering gameplay image

After entering gameplay image

The game is running as a host image

Environment

  • Windows 10
  • Unity Version: 2022.3.16f1
  • Netcode Version: 1.9.1

yousefkmail avatar May 06 '24 13:05 yousefkmail

Validated the bug and have a PR up for the fix. 👍

NoelStephensUnity avatar May 06 '24 17:05 NoelStephensUnity