- Home /
Network or camera desync or something else?
So my problem is that i'v recently got an model for my multiplayer character, iv imported it and set it up decently. Before i used a cube prefab as a player model and it worked fine, now when changing to the new model, it acts wierd, i dont know if its the cameras fault or the synchronization fault or are just rpcs failing. Basically the problem is that when using this player model, the player like flickers between two points, one point is 0,0,0 and the other is the right position where the data is sent and recieved, when moving its fine, but when the player stands still then he starts to flicker between two points.
I used one of these to synchronize movements and made some modifications
var position1 : Vector3;
var rotation1 : Quaternion;
var move : boolean;
function Update ()
{
move = false;
position1 = gameObject.transform.position;
rotation1 = gameObject.transform.rotation;
}
function OnMouseDrag () {
networkView.RPC("SendMovement", RPCMode.OthersBuffered, position1, rotation1);
Debug.Log("On Mouse Drag: ");
}
function OnMouseExit () {
Debug.Log("On Mouse Exit: ");
}
@RPC
function SendMovement(position1 : Vector3, rotation1 : Quaternion)
{
gameObject.transform.position = position1;
gameObject.transform.rotation = rotation1;
}
Il put a picture in attachments, maybe someone can help me about it. Any suggestions are welcome.
NB! Still not working but found out that if the character has rigidbody attached to it, then it flickers between to points else it doesnt
Yes, the model has good amount of animations attached to it and being controlled with mecanim system
Your answer
Follow this Question
Related Questions
Best way to sync rigidbodies realtime? 1 Answer
Unet Rigidbody Sync on Client 2 Answers
Best Unet. 0 Answers
Photon Network syncing the transform of a moving platform 0 Answers