Hello guys.
I’m trying to pick up weapons from the ground.
First, play animation and then snap the root component of weapon to character socket.
But if I snap the root component of weapon to socket, the weapon don’t receives the correct location.
If I snap only the weapon mesh, the weapon receives the correct location, but if I throw out the weapon and pick up again, weapon receives incorrect location.
Somebody?
This code causes the weapon to receive incorrect position
ACharacterMS* GetChar = Cast<ACharacterMS>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
WeaponRootBox->SetHiddenInGame(false);
WeaponRootBox->AttachTo(GetChar->FPVMesh, "WeaponSocket");
and this code causes the weapon to receive the correct position,
but to throw it away and then take the gun back she does not receive the correct location of the socket
ACharacterMS* GetChar = Cast<ACharacterMS>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
WeaponMesh->SetHiddenInGame(false);
WeaponMesh->AttachTo(GetChar->FPVMesh, "WeaponSocket");