#Networked Physics | How should I perform rigidbody player collisions in peer-to-peer?

7 messages · Page 1 of 1 (latest)

cobalt oxide
#

I've created a small multiplayer project which so far instantiates player objects using the multiplayer spawner. Only the host instantiates both player's characters and both have rigidbodies and move using them with applied forces.

As of right now, each client handles the physics for its own object and simply uses the multiplayer synchroniser for player objects it does not own.
I want the players to collide but I don't think that is possible without running both player's physics on the host and transmitting the input to the host to handle. This seems elaborate so if someone can help me to understand it better and maybe offer a solution that would be helpful.

open iron
cobalt oxide
#

I think I am confused by what you mean when you say 'an authority'. My understanding was that the authority is just the client?

cobalt oxide
#

Okay I am perhaps stupid but I have figured it out

#

I definitely overthought it

#

I made a previous fix which would disable the physics on the player objects you dont own. But it was also disabling collision. So now it is fine.

#

If people are wondering how it is setup and they want to know how to perform rigidbody collisions in peer-to-peer then mine simply works by allowing each player to control the players they have authority over (themselves) and then the multiplayer synchroniser just updates the position and rotation of the player object you don't own.

Just make sure you disable the physics of any players you dont own so that you don't start getting weird ghost objects like I did.