Fast collisions with Photon Rigidbodys (Golf game)

I am working on a networked golf game and trying to add collision between the balls. Each player has a ball prefab with Photon components like so:

As it is right now, the balls often don't register a collision when they are moving too fast, although they register fine for slower collisions. Is there any other setting that can help me register fast collisions?

An alternative is to have the master client own all the balls and simulate all the movement. However, that's not very smooth from the player's perspective because every time they hit their ball, they might have to wait 100-200 ms to see it actually move.

Any ideas welcome!


  • I could increase the send rate but that might be a bad idea.
  • And if the answer is "You just have to do it on a master client"... I would appreciate some basic tips on that.
  • Each player has its own Golfball? So the balls are just syncd over the network,means u only sync position , the collision detection should hapen on the owner side.
    What you are locking for is
  • Hi S_Oliver,

    The balls are all set to Continuous Dynamic. The physics itself works, it's definitely a network problem. When the balls move too quickly, the Photon Rigidbody View doesn't register a collision.
  • S_OliverS_Oliver ✭✭
    edited August 2018
    The Rigidbody View itself only Sync the Velocity, it dont detect Collision.

    Try the same Offline, use only the Rigidbody and see what happen.
  • Thanks for the reply.

    So I did try the collision offline, and the collision itself works locally, even with very fast movement.

    Now I see that the Rigidbody View only syncs velocity. If I wanted to detect a collision over the network, how should I do so?
  • Bumping my thread. Any suggestions for collision detection over the network, as the Rigidbody Views aren't really for that purpose? Should I go for a model with an authoritative master client or not? Open to any ideas!
  • Still open to any ideas!
  • Still open to any ideas!
  • STILL open to any ideas! Not sure why I've been trolled... Great customer support
  • sah1234sah1234
    edited August 15
    For the annals of history, collision detection is done through a custom rpc setup. Not perfect but definitely fine for this use case.

    void OnCollisionEnter(Collision collision)
    if (!photonView.IsMine)

    Collider other = collision.collider;

    if (other.tag != "PlayerBallNetwork")

    Vector3 otherVelocity = other.attachedRigidbody.velocity;

    //Set other velocity
    PhotonView otherPhotonView = other.transform.root.GetComponent();
    Player otherPlayer = otherPhotonView.Owner;
    otherPhotonView.RPC("SetVelocity", otherPlayer, otherVelocity);

    void SetVelocity(Vector3 velocity)
    rb.velocity =;
    rb.AddForce(100 * velocity); //Change this for more forceful collisions
  • MinitteMinitte
    edited August 20
    I had a sort of a similar problem that I'm fixing. I think the reason why collisions are not consistent is that the objects are actually teleporting to their new locations and the colliders will actually teleport inside each other.

    Maybe if the physics is done on the master client's side and everyone else would sleep the rigidbody every frame.
Sign In or Register to comment.