Hi,
I have a problem with animations sync when instantiate AI charactere over the network.
First, here is the procedure I followed to instantiate the AI charactere over the network:
1) instantiate AI charactere on the Master Client using PunObjectPool.Instantiate
2) Send RaiseEvent containing photoView.ID and custom data to others clients
3) When received RaiseEvent, instantiate AI charactere on others clients using PunObjectPool.Instantiate (using also photoView.ID and custom data).
At this moment, position, transform and health are synchonized nicely. Characteres move on the Master Client and also move on others Clients, but walk animation is played only on the Master Client!
I investigated and the conclusion is that datas animation (speed, move etc...) are send by MasterClient and received by clients, but on the clients, datas are constantly overwritten by UpdateAnimator() from CharactereLocomotion.
I found the following workaround to prevent datas to be overwritten by UpdateAnimator() from CharactereLocomotion:
the workaround works but I don't like to modify the asset files.
i also try to instantiate AI charactere using PhotonNetwork.Instantiate or PhotonNetwork.InstantiateRoomObject, same issue.
Screenshot of my AI charactere components.
Thanks for help !
I have a problem with animations sync when instantiate AI charactere over the network.
First, here is the procedure I followed to instantiate the AI charactere over the network:
1) instantiate AI charactere on the Master Client using PunObjectPool.Instantiate
2) Send RaiseEvent containing photoView.ID and custom data to others clients
3) When received RaiseEvent, instantiate AI charactere on others clients using PunObjectPool.Instantiate (using also photoView.ID and custom data).
At this moment, position, transform and health are synchonized nicely. Characteres move on the Master Client and also move on others Clients, but walk animation is played only on the Master Client!
I investigated and the conclusion is that datas animation (speed, move etc...) are send by MasterClient and received by clients, but on the clients, datas are constantly overwritten by UpdateAnimator() from CharactereLocomotion.
I found the following workaround to prevent datas to be overwritten by UpdateAnimator() from CharactereLocomotion:
C#:
protected override void UpdateAnimator()
{
if (m_NetworkInfo != null && !m_NetworkInfo.IsLocalPlayer())
{
return;
}
.....
.....
.....
}
the workaround works but I don't like to modify the asset files.
i also try to instantiate AI charactere using PhotonNetwork.Instantiate or PhotonNetwork.InstantiateRoomObject, same issue.
Screenshot of my AI charactere components.
Thanks for help !