Currently I’m working on an Aim Down Sight system with the ViewModel that I created.
This is currently what do I get:
char.Torso.ToolGrip.C0 = char.Torso.ToolGrip.C0 * CFrame.new(-1,0,0) ViewModelTorso["Left Shoulder"].C0 = ViewModelTorso["Left Shoulder"].C0 * CFrame.new(0,0,1) ViewModelTorso["Right Shoulder"].C0 = ViewModelTorso["Right Shoulder"].C0 * CFrame.new(0,0,-1)
For now, I pretty much just simply offset the Left Shoulder, Right Shoulder and ToolGrip Motor. ToolGrip is a custom Motor that connects the tool between tool’s handle and player’s character torso. It is visible in the ViewModel but not a descendant of the ViewModel, it’s a child of the player’s character.
There’s an AimPart inside the tool, What I want to achieve is the AimPart will be positioned in the center of the Camera, here’s the pseudo steps:
- Calculate the offset between AimPart and the Center of Camera in CFrame
- Let’s say the offset is (-1,0,0), then multiply it to current CFrame (Like I did above)
- Then also multiply this offset to Left Shoulder and Right Shoulder such that they will be positioned correctly.
Currently what I did (Code above) does not put the tool in the center the screen, it didn’t even utilize the AimPart inside the tool and here’s the result:
ADS (Red Part is the AimPart)
I have all the pseudo steps but I don’t really know how to perform this in code