Hi, i have a problem with NetworkTransformChild when I take, drag and leave the green cube (parent of red) all is ok, but when i take, drag and leave the red cube (child of green) it will turn to the previous position.
i made a video with a simple scene for explaining the problem: https://www.youtube.com/watch?v=WQExHvRSQZQ
Components used:
- Green cube have: NetworkIdentity, NetworkTransform, NetworkTransformChild(for red cube) Components.
- Red cube have: Nothing about network.
My NetworkPlayer code is:
GameObject SelectedObject = null;
...
if (Input.GetKeyUp (KeyCode.Mouse0)) {
if (SelectedObject == null) {
SelectedObject = hit.transform.gameObject;
CmdAssignObjectAuthority (hit.transform.root.GetComponent ().netId);
} else {
CmdRemoveObjectAuthority (SelectedObject.transform.root.GetComponent ().netId);
SelectedObject = null;
}
}
...
[Command]
void CmdAssignObjectAuthority(NetworkInstanceId netInstanceId)
{
NetworkServer.objects[netInstanceId].AssignClientAuthority(connectionToClient);
}
[Command]
void CmdRemoveObjectAuthority(NetworkInstanceId netInstanceId)
{
NetworkServer.objects[netInstanceId].RemoveClientAuthority(connectionToClient);
}
Thanks to all for your help.
↧