I am purposely not ticking my character’s mesh pose on dedicated servers (for optimization).
if (GetNetMode() == NM_DedicatedServer && GetMesh())
{
GetMesh()->VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::OnlyTickPoseWhenRendered;
}
However, I need the animated location of my character’s hand on the dedicated server in order to drop weapon pickups from that location.
Is there someway to force an update the mesh’s pose on the dedicated server before dropping a weapon so I have the correct bone location?
I have tried doing the following, but it didn’t work.
if (GetMesh)
{
GetMesh()->RefreshBoneTransforms();
GetMesh()->UpdateComponentToWorld();
}
Edit:
So the following is partially working.
I’m doing the following from character right before dropping the weapon
GetMesh()->TickPose(GetWorld()->GetDeltaSeconds(), false);
GetMesh()->RefreshBoneTransforms();
This seems to start off in the wrong location (tpose location) and gradually get closer and closer to the correct animated location the more I drop the weapons.
The location I am spawning the weapon pickup at is
Weapon->getMesh3P()->GetComponentLocation()
Thank you!