Unity-Technologies / com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.16k stars 435 forks source link

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

Closed yousefkmail closed 6 months ago

yousefkmail commented 6 months ago

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

NoelStephensUnity commented 6 months ago

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