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

`PhysicsPlayer` local player of `PhysicsSample` cannot be controlled by client

Open LoneDev6 opened this issue 3 years ago • 2 comments

Description

The PhysicsPlayer cannot be controlled (using WASD or arrow keys) by the client, it doesn't move at all.

Reproduce Steps

  1. Open the PhysicsSample scene
  2. Host a game
  3. Open a new instance and join the game
  4. Try to move the player on the client instance, the player won't move.

Actual Outcome

The client player can't be controlled at all.

Expected Outcome

I'd expect the client to be able to control the player and move it around, exactly how the host can move their own local player.

Screenshots

image

Environment

  • OS: Windows 10
  • Unity Version: 2021.3.2f1
  • Netcode Version: 1.0.0-pre.9
  • Netcode Commit: https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/9f950ceb66716d746e9f7c5ac48878359173efca

LoneDev6 avatar Jun 05 '22 13:06 LoneDev6

This is probably a bug in the Sample, and the Sample may be broken.

ashwinimurt avatar Jun 06 '22 19:06 ashwinimurt

Backlog MTT-4083

ashwinimurt avatar Jul 12 '22 23:07 ashwinimurt

@LoneDev6 There were recent updates to the PlayerMovement script that no longer require the NetworkTransform component. (PlayerMovement derives from NetworkTransform now)

I will open a PR to resolve this issue with the sample, but for the time being if you remove the NetworkTransform component from the PhysicsPlayer prefab it should work as expected.

NoelStephensUnity avatar Sep 30 '22 01:09 NoelStephensUnity

Thanks for the efforts but I had to move to another solution since this doesn't seem production ready.

LoneDev6 avatar Sep 30 '22 09:09 LoneDev6

@LoneDev6 I am sorry to hear that, but glad you found the netcode solution that meets your project's needs.
Hopefully you will consider using Netcode for GameObjects with your next Unity project.

Best Regards,

Noel

NoelStephensUnity avatar Sep 30 '22 16:09 NoelStephensUnity

The fixes will be in the next update and are now merged into the develop branch.

NoelStephensUnity avatar Oct 01 '22 02:10 NoelStephensUnity