- Home /
How do I sync Client bullet rotation on network?
I'm making a 2D game that requires that I be able to shoot in both the right and left directions which is synced properly for the host player but for the clients, my bullets continue to shoot right when I am facing left.
I am instantiating the bullet in CmdFire(); to sync on the server with an if facing right, instantiate bullet, and fire right, else run the clientRpc as that is where my problem lies. Using a client rpc to sync for clients but the clients refuse to sync. Any suggestions?
This is my ClientRpc:
[ClientRpc] void RpcFire(Vector3 position, Quaternion rotation) { GameObject bullet = Instantiate(bulletPrefab, bulletSpawnPoint.position, Quaternion.LookRotation(apm.transform.forward * -1f, apm.transform.up)); NetworkServer.Spawn(bullet); Destroy(bullet, 2.0f); }
Your answer
Follow this Question
Related Questions
I don't know difference between interpolation and non-interpolation 0 Answers
What happens if you call MasterServer.RegisterHost twice with same parameters? 0 Answers
How can i send a Player list to every Client 0 Answers
Planning 2-4 player game for iPad; do I want / need Photon? 0 Answers
Connect to remote private IP 1 Answer