How do I replicate Real Arm movements to Fake Arms (ViewModel)?

You shouldn’t need to change the C0. Just the Part1. If you attach it to a part in the same location as the root the offset is the same.

Edit: I was misreading your snippet sorry
Can’t you simply use the ToolGrip already there instead of using one separate from the character?

1 Like

If I use the original ToolGrip then it won’t follow the camera like the arms? ViewModel also use a separate Motor6D though

1 Like

I mean reattach the original ToolGrip on the client to the arms of the viewmodel (as in the ones that move with the camera.)

My custom ToolGrip is parented to the character’s Torso though, it’s Part0 is Torso and Part1 is BodyAttach.

Edit: I tried, The Part0 of Torso’s BodyAttach is ViewModel’s Root now, The Part1 remains the same (Gun’s BodyAttach) However, the animations of BodyAttach are not replicating. only parts inside the gun such as Magazine drop and moving bolt are working.

From the GIF, you can see that the BodyAttach base part is not moving (The recoil animation) but the reloading magazine are working fine, does this have to be done by renaming the Motors?
(I temporary attached Part0 to a random part in workspace such that the weapon will be visible.)

https://gyazo.com/e9fad2fac532148dd7161b521bce1e09

Edit: It’s fixed and all fine!
Turns out the ViewModel’s Root name has to be exactly same as “Torso”, which is the name I use when animating it. It works now and thanks for everyone help!
https://gyazo.com/ac5c35f2bb7053293a0c1cabeb4e5d80

10 Likes

I’m still having problems without putting tool into the player’s arms.
I have the arms working, but the tool is pretty hard.

I have tried all steps, Headstackk said, with no success.
Also, I’m trying to make is as tool. I think Headstackk did too.
I don’t even need animations now, I’ll be just happy if it would be in the hands. I can animate it later.

1 Like

May you please share the new offsets/CFrames with me because I am unable to figure it out. I’ve tried doing quite a bit!

Thank you!

1 Like

What problem are you having? I’m not quite sure which CFrame to share.

The arm offset problem in post 50.

The one in posts 50 is not a Viewmodel!
That’s from:

1 Like

Alright, my apologies but what did you end up doing to solve this problem?

The problem was animation not playing due to the Motor6Ds name and character’s Motor name not being the same, what problem are you countering right now?

Well, this is the problem that I am encountering is that the arms are not moving the way I need them to unlike your video, I also couldn’t really tell your solution to that problem, because I much rather do it your way, due to the way you setup the guns. But this is what I tried:

game:GetService("RunService").RenderStepped:Connect(function()
char.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).unit.y),1.55,0)
char.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(-math.asin((mouse.Origin.p - mouse.Hit.p).unit.y),-1.55,0)

end)

But this is the problem I run into,

https://gyazo.com/77f663cfaa20fb4ad51a838e66f4cebb

As you can tell, the gun and the arms do not stay at a set height.

If you know any solutions please let me know.

Did you even apply a ViewModel? This is just the arms following the mouse position, not a ViewModel?

1 Like

Very much appericated i advise him to recap over EgoMoose’s Viewmodel example very helpful,make sure if do that,replicate it to the client also which is included in his post

This is why i switched to Unity i can make a viewmodel so much better and easier

Hello, im trying to make something similar, so i tried to apply the @Hexcede idea on post 43.
I also switched “char.Torso[“Right Shoulder”].Part0.CFrame * camera.CFrame:Inverse()” with “camera.CFrame * char.Torso[“Right Shoulder”].Part0.CFrame:Inverse()” as it shows on post 49, but it’s still very far from working, and i dont have any idea to fix it. :neutral_face: :thinking:

This is how it works:

Code:

runService.Stepped:Connect(function()
    local cameraOffset = camera.CFrame * char.Torso["Right Shoulder"].Part0.CFrame:Inverse()
    local offset = char.Torso["Right Shoulder"].C0 * char.Torso["Right Shoulder"].C1:Inverse()
    local newLocation = camera.CFrame * cameraOffset * offset
    local oldLocation = char.Torso["Right Shoulder"].Part0.CFrame * offset
    char.Torso["Right Shoulder"].Transform = char.Torso["Right Shoulder"].Transform * oldLocation:Inverse() * newLocation
end)

Any help is welcome! :slightly_smiling_face:

1 Like

@Headstackk If I’m not mistaken, in order to solve the problem of moving the tool into the view model’s hands, you ended up renaming the torso of the view model to Torso? When I did that, it worked as expected, but the first person collision issue from the solution post happened again. Can you explain how you resolved that?

You can set the view model to a separate collision group

I’m not sure that’s the issue, since I already have the view model and tool set to cancollide false. I’m guessing that it has something to do with the fact that two humanoids are on top of each other, but I’ve seen it in other games.

When I set the viewmodel collision group to its own category i resolved the glitching for me

I’ll try it, but it says on the roblox developer website that when cancollide is set to false, the part will not collide with anything under any circumstances.

Edit: nvm, it did work, tysm for your help!

1 Like