I had made a simple shooter game. In the game when a player shoots a target .it's destroyed and new target spawns elsewhere, but for performance sake i just change the x,y of the target instead of actually creating and destroying it.
So i made a multiplayer version , and I could do it with the help of the tutorials..
But I'm having a problem on the Peer's side, where the target, when is shot and position is to be changed, instead of it just changing position instantly, it is shown to move from original position to the new position.
I suspect it's cause I had synced its position in the multiplayer object and the multiplayer object is always trying to predict it's position, hence showing it moving to it's new position.
So what i did was, Instead of syncing position, I synced variables which will hold the position of the target, and on the Peer side I just give it a command to set it's position to this variables instead.
Is this method ok?, or is there another workaround?
And one more doubt.
I make the host send a blank message with a tag to the peer, everytime the target is hit, so the peer will set the target's position only when it receives the message, instead of every tick.
Is this method acceptable/reliable?