Thank you for your reply.
I don't have some TNAutoSync nested on the object.
I have the player's object that have 2 scripts that extend class TNBehaviour:
public class GamerPlayerEach : TNBehaviour
e
public class GamerPlayer : TNBehaviour
Can I do this? Because it's more easier for me to divide scripts.
Player's object have got only 1 TNAutoSync that is setted as:
Transform -> rotation
Updates per second: 3
Saved on server: yes
Important: yes
Only owner can sync: yes
I have a script that synchronize manually the position and the direction of the movement to be performed:
void Start()
{
// Resync
if(tno.isMine)
{
StartCoroutine(AvviaResync());
}
}
IEnumerator AvviaResync()
{
while(true)
{
yield return new WaitForSeconds
(0
.10f
); tno.Send("resync", TNet.Target.Others, transform.position, movimento);
}
}
[RFC]
void resync(Vector3 myposition, Vector3 destinazione)
{
transform.position = myposition;
movimento = destinazione;
}
I see the errors by unity, so as it should be easier to understand the problem, and it appear to me this problem:
Exception has been thrown by the target of an invocation.
TNAutoSync.OnSync (System.Int32)
UnityEngine.Debug:LogError(Object)
TNet.UnityTools:PrintException
(Exception, CachedFunc, Object[]) (at Assets/Library/TNet/Client/TNUnityTools.cs:83)
TNet.UnityTools:ExecuteAll(List`1, Byte, Object[]) (at
Assets/Library/TNet/Client/TNUnityTools.cs:161)
TNObject:Execute(Byte, Object[]) (at Assets/Library/TNet/Client/TNObject.cs:311)
TNObject:Start() (at
Assets/Library/TNet/Client/TNObject.cs:258)
failed to convert parameters
GamePlayer.resync (System.Int32, System.String)
UnityEngine.Debug:LogError(Object)
TNet.UnityTools:PrintException(Exception,
CachedFunc, Object[]) (at Assets/Library/TNet/Client/TNUnityTools.cs:83)
TNet.UnityTools:ExecuteAll(List`1, String, Object[]) (at
Assets/Library/TNet/Client/TNUnityTools.cs:192)
TNObject:Execute(String, Object[]) (at Assets/Library/TNet/Client/TNObject.cs:322)
TNObject:Start() (at
Assets/Library/TNet/Client/TNObject.cs:257)
I don't know why the error signs: GamePlayer.resync (System.Int32, System.String)
When I switch 2 Vector3 as parameters.
One thing that should be useful is that I have the host that must press the start's button, when he press the start's button I send an RFC to all the client, and all toghether create the GameObjectPlayer.