Player2 does not move(NetworkRigidbody)
Hi, just switched to Fusion from PUN, and was wondering if was it possible to move a client player in host/client mode and then just sync it with a NetworkRigidbody(as I used to do on PUN).
I mean, I have a scene where 2 players spawn with a different prefab depending on the order of the players, each prefab has its own script and each of them has a FixedUpdateNetwork() with a simple move:
if (Runner.LocalPlayer.PlayerId == 0)
{
Vector3 newPosition = transform.position + (Vector3.right * 5 * Runner.DeltaTime);
rb.MovePosition(newPosition);
}
So both can only be read by the owner, and both have the NetworkRigidbody component to be synchronized.
The problem is that only the host's character moves, while the other remains stationary.
I miss something?
Comments
-
If you're trying to make objects move based on input, you need to use Fusion's input system. There's a good introduction to it here. https://doc.photonengine.com/en-us/fusion/current/fusion-100/fusion-102#collecting_input
Fusion works very differently to PUN, but the advantage is that network objects sync very well out of the box.
0