How do i set an part rigged to the character to follow the arm where it's supposed to be in a animation

im trying to make these types of viewmodel who are straight up the character’s arms rotating up and down,but i can’t rotate my gun.
i have tried setting the part motor6d(which connects it to the hrp) to the rightshoulder and it worked on my other weapon, but with my gun it doesn’t!

If you are using the character’s physical arm, just equipping the tool should work fine. Is the gun welded to anything else?

yep, the humanoidRootPart, to have more freedom animating it.

I believe the issue is that the tool’s handle you welded to the root part has to be the same exact name as the tool’s handle that you animated with or the RightGrip() is parented by a different object when welded.

RightGrip just attaches the Handle to the player.

When a tool is equipped, the default Animate script will play the toolnone animation with priority Enum.AnimationPriority.Idle. Additionally, if a tool has a StringValue child instance named toolanim with the Value property equal to one of "None", "Lunge", or "Slash", then it will play other animations, with the last two being at Action priority.

However, I think this system is simply legacy code for gear scripts written by Roblox, so not intended to be used by developers.

I found this randomly, someone who experienced a similar issue as yours almost a year ago: How do I fix this issue with my gun not syncing movement with my arms?

Did you make sure the mesh part(s) are welded to the Handle of the tool