Hey there, i have a basic game with photon integrated.
Basically it is about shooting bullets, but not via “RayCast”, it is more about shooting bullets at normal speed
(so you still can see bullets moving on screen).
So what i did:
Player A shoots.
- Bullet is instantiated locally
- RPC is send to all clients, including the instantiation position of the bullet
Player B receives RPC - Bullet is also instantiated locally with given position from RPC
So far so good.
When Player B gets hit by this bullet:
- first the bullet-gameobject gets destroyed locally
- secondly Player B sends RPC to all clients that he was hit and that they should delete this bullet locally too.
So collision detection with bullet is always done on the client, who gets hit
and next he informs all other clients about this event.
So… it works fine ![]()
BUT:
Before Player A gets notified about his successfull shot, in his client the bullet already collided with Player B and moved on and was destroyed far to late…
So anyone knows a proven strategy to solve this problem?
Should i change my strategy or move to an other solution… ?
Thanks and Greetings!