Custom SpawnHandler does not support rotation on the client, only the position is supported
Hi,I am using the UNet system and I am implementing the Object Pools pattern as described here . The problem is that SpawnDelegate does not support rotation, only a position is allowed in the delegate. So I can't rotate my bullet on the client (to be on the same direction of the player forward) and i find myself relying on the server to "correct" it's direction, so I always see the "correction" on the clients and it is very ugly . any workaround ?!
Answer by muzboz · Mar 30, 2016 at 09:38 AM
You probably want to use the components NetworkTransform and NetworkTransformChild appropriately on your objects.
I had troubles getting rotations to sync across the network, on child objects on my player (like the gun), until I discovered that I needed to put an extra NetworkTransformChild on the root player object, and drop the Weapon object onto that. Add another NetworkTransformChild to any children game objects that you need to sync position and rotation across the server!
All the best!
Murray
hey thanks for your response. I did not know anything about NetworkTransformChild also, thanks !
Your answer
Follow this Question
Related Questions
Managed to set up Multiplayer Online on one Computer, but not on 2 0 Answers
Projectile not rendering for client when moving too fast 0 Answers
Unet - spawning bullets, two issues 1 Answer
Unity Photon Handle Match Data 0 Answers
ClientRPC not called from command on client instance during Start() 0 Answers