Hello, I have been recently been working on my guns, and I’m working on the ADS.
However, these guns are not CFrame they use animations, and I do not have animations for first person or ADS.
I have a custom first-person script, and my current hacky way of doing an “ADS”, is by creating a CFrameValue in the tool which is then tweened with TweenService, and picked up by the first person script.
As you can see, it does “work” kinda but it looks quite scuffed.
https://gyazo.com/ee8cb49eb71ffa80d57db1d82d9f0a2c
aim_Tween3 = TS:Create(FP_OffsetValue, TweenInfo.new(speed, Config.AimSettings.EasingStyle, Config.AimSettings.EasingDirection), {Value = Config.AimSettings.Offset})
aim_Tween3:Play()
And this is how it looks in the config
Offset = CFrame.new(-0.58,0.3,0.9) * CFrame.Angles(math.rad(0.75),math.rad(0.8),0);
This is an overview of the problem I am having with the ADS:
Since it isn’t actually set to the camera and I’ve just had to manually try and get the best offset, it isn’t aligned properly and some guns look much worse.
What is the best way to fix this? Is it still possible to perfect it with an offset CFrame like so? This is the code in my FP script:
local cF = viewModel.HumanoidRootPart.CFrame:Lerp(cam.CFrame:ToWorldSpace(CFrame.new(Vector3.new(0,-1.65,-1))),0.8) --Lerps for smoothness
if tool:FindFirstChild("FP_Offset") then
cF = cF * CFrame.new(tool.FP_Offset.Value.X,tool.FP_Offset.Value.Y,tool.FP_Offset.Value.Z)
end
if tool:FindFirstChild("FP_Offset2") then
cF = cF * tool:FindFirstChild("FP_Offset2").Value
end
local swayTing = 1
if tool:FindFirstChild("Values") and tool.Values:FindFirstChild("AimDown") and tool.Values.AimDown.Value then
swayTing = 0.2
currentRelPart = torso
else
currentRelPart = hrp
end
cF = cF * SwayModule.GetSwayCF(swayTing)
viewModel.HumanoidRootPart.CFrame = cF