Synchronizing shared ball object for soccer/football game

Options
Hello everyone.

We are developing a realtime multiplayer soccer game with Unity and PUN. The gameplay consists of two bubblehead characters and a ball. We successfully synced players using PUN's great new features, but we are having trouble syncing ball object.

After reading tons of post and articles we have tried two following methods :

1) Master client controls it's character and the ball and client takes ownership of the ball before interaction. Problem with this method is that before ownership transfer occurs the ball jitters while colliding with client and then receives a kick. Sometimes player weirdly drags the ball before transfer occurs thus creating confusing experience for the user.

2)Master client controls both characters and the ball, so that all the interactions and calculations occur on the master side and the client sees only synchronized movement. Client sends RPC calls of the input to the master and master executes actual movement. In this case problem is lag when client presses button it has to wait till master receives and executes RPC and synchronizes transforms back to client.

We know that this is an age old problem but maybe you have any ideas or suggestions.
Your help will be highly appreciated.

Comments

  • SKyTech6
    Options
    I have a ball in my game as well. I put the "Photon Rigidbody 2D View (Script)" on my ball and then put that script into the Observed Components. My ball is now perfectly synced.

    There is a non-2D variant of their script as well.
  • robokai
    Options
    SKyTech6 said:

    I have a ball in my game as well. I put the "Photon Rigidbody 2D View (Script)" on my ball and then put that script into the Observed Components. My ball is now perfectly synced.

    There is a non-2D variant of their script as well.

    hello both @SKyTech6 and @Mobius , just out of curiousity, did you go with solution 1 or 2 above?