I cant find a place in the code or in the blueprint where rotation of the first person mesh of weapon is changed.
Its all about attaching weapon to the bone socket of the character, cause by default weapon is always pointing down, so it should be rotated to -90 degrees (yaw).
But when im looking at how weapon c++ code and blueprint was made I cant find any difference in first person mesh settings, only in third person mesh. What i’m missing? =(
Its even more confusing when Im trying to do my own blueprint with
UPROPERTY(EditDefaultsOnly) for first and third person meshes of weapon with new rotation parameters, so it should point in right direction, but that doesnt change anything in the game.
Anyone? I still cant find any changed settings for first mesh…how they did it… huh…
if mesh build root, rotate is invalid, root only have scale
Yeah, you right. The first person mesh for weapon item is a root mesh. But somehow they rotated it…I cant find how they did this…
I know this is an old post, but I believe I have an answer as I have been trying to find the same thing.
It’s in the ShooterWeapon.cpp in two different functions: DetachMeshFromPawn() and AttachMeshToPawn().
I think this is how it works:
- Weapons spawned with no rotation.
- Weapons attached to socket (with no rotation)
- Weapons Detached from mesh BUT with rotation of the mesh using FDetachmentTransformRules::KeepRelativeTransform when detaching from Character mesh. At this point, the weapon is no longer attached to the socket on character mesh BUT does have the correct rotation.
- Weapons reattached to character mesh using the socket and weapon has same rotation.
I’m not 100% sure this is correct but I hope it’s right or at least in the same ball park.