Trouble with multiplayer montages

i followed rakiz’s tutorials on youtube, and i tried out the project with two cients, and you can’t see the montages play on the other clients window, and, you can’t see the other player in combat mode in the other clients window. when i added shooting, which i stole from the first person template (migrate) the other client can’t see me shoot, either!
i would really appreciate any help at all.

thanks!

I have looked into replication, not for this project, but for orther projects. can anyone tell me why a multicast event to play a montage does not work?

Are you calling the multicast from the Server? Calling a multicast from a client will not propagate to the other clients.

When I try calling multicast from the server as in if server is true then call function, it plays the montage in both windows, but, I can’t run the function with the client, because server would then be false.

Sounds like your on the right track. I found that using ReplicatedUsing properties make it much easier. Your code should look something like this:

void AMyClass::DoSomething()
{
    if (Role < ROLE_Authority)
    {
        UAnimMontage* montageToPlay = GetMyMontageToPlay();
        Server_PlayMontage(montageToPlay); //call to server to set montage 
    }
}

void AMyClass:Server_PlayMontage_Implementation(UAnimMontage* NewMontage)
{
   //MontageToPlay is set to ReplicatedUsing = OnRep_PlayMontage
   MontageToPlay = NewMontage; //will get replicated to all clients
   OnRep_PlayMontage(); //code still needs to be run on server
}

void AMyClass::OnRep_PlayMontage()
{
   GetMesh()->GetAnimINstance()->Montage_Play(MontageToPlay); //play the montage
}

I don’t replicate an UAnimMontage but instead an enum which I then use to grab the correct montage to play. Hopefully this get’s you to your goal and helps you understand replication a little more.