I’m creating a network object prefab where the player is expected to move around on a small plane.
The player has a Network Animation component, and the plane has a Network Transform component. However, with this setup, when I connect as a client, the transform and animation are not synchronized.
I’m thinking of attaching all the components to the player and having the plane follow as its child.
But even with Rigidbody and Collider attached, the player still goes through the plane.
Could I get some advice, please?"
In essence, if you make the plane (floor) a child of the player you’re setting it up like this.
If the plane is not moving, make it a static object with a collider. Any other object with a collider and rigidbody collides with this by default. Make this work with a non-networked player first.
Then to make the rigidbody player networked, you’d have to use the NetworkRigidbody component on it as well. If you want the plane to move as well, it needs to have a NetworkRigidbody too.
Note: networked physics, whether server- or client-authoritative, will exhibit rather odd behaviour due to latency (server authoritative) or physics simulation running non-synchronized on each local client (client authoritative). To make network physics “behave” (at least decently) a combination of these two approaches ought to be used, and it will still fall apart the more fast-paced the game is.
Hi, CodeSmile.
Yeah,that picture makes sense:)
It didn’t move as expected when I placed the plane as a child of the player, so I looked into it a bit more and it seemed to be related to this issue.
Based on the logs, it appeared that there was something wrong with the input, resulting in a situation where the client’s movements were restricted. I will investigate further.
Thank you as always!