I’m having an issue with my equipping and holstering weapon ability: Gameplay Issue for Holstering posted by Ryuku | blueprintUE | PasteBin For Unreal Engine
That’s the blueprint
The associated code for the AttachGun
function is
void UHolsterWeapon::NetMulticastAttachGun_Implementation(FName GunSocketName) {
AShooterCharacter* Hero = Cast<AShooterCharacter>(GetAvatarActorFromActorInfo());
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
Hero->GetGunComponent()->AttachToComponent(Hero->GetMesh(), AttachmentRules, GunSocketName);
}
void UHolsterWeapon::ServerAttachGun_Implementation(FName GunSocketName) {
NetMulticastAttachGun(GunSocketName);
}
void UHolsterWeapon::AttachGun(FName GunSocketName) {
ServerAttachGun(GunSocketName);
}
The problem is that it all works correctly on the locally controlled character as expected, but for some reason on the server, only the equipping anim notify event triggers and it doesn’t trigger for the holstering. Then between 2 clients, it just doesn’t trigger the anim notify and the gun never gets attached to either socket. The gameplay event is triggered by an anim notify on the anim montage. Any ideas??
Even removing the wait for gameplay event node for the non-locally controlled character logic, the holstering doesn’t attach the skeletal mesh to the back, but work when equipping. Between 2 clients, attaching the skeletal mesh of the gun to the characters hand and back just doesn’t work. It just stays on the back all the time.