Pretty much I have a Third Person Camera script that normally works just fine that handles moving the camera and has the players Character face forward where the mouse is pointed.
I use this with shooter games and it has usually worked as I have usually attached the gun to the players right hand via Motor6D. But I decided to attach the gun to the players UpperTorso to make the animations easier(Bolt action stuff) but this seems to have broken the way the character points.
It seems like the arms or just hands aren’t moving with everything else and causes a weird effect. This works normally when the weapons are attached to the right hand. Everything is does via Roblox Animations by the way in terms of holding and shooting and such. I am not sure if I will have to reroot the model and redo the animations or if there’s just another motor I need to create or something? Any help is appreciated
When Working:
https://gyazo.com/dd6ae39c797076eced53dc61c2c22782
Not Working:
https://gyazo.com/6aa4357ef75dae3c9c533906cc18a9fd
Here is the parts of the script that handle the characters direction and such. This is handled exactly the same way in both Gifs:
local Plr = game.Players.LocalPlayer
local ts = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")
local Run = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local M = Plr:GetMouse()
local char = Plr.Character
local hum = char:WaitForChild("Humanoid")
local waist = char.UpperTorso:WaitForChild("Waist")
local root = char:WaitForChild("HumanoidRootPart")
game:GetService("RunService").RenderStepped:Connect(function()
if hum.Health > 0 then
local LowT = char:WaitForChild("LowerTorso")
local HighT = char:WaitForChild("UpperTorso")
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
local delta = UIS:GetMouseDelta()
local deltaX, deltaY = delta.X, -delta.Y
Camera.CFrame = CFrame.new(Camera.CFrame.p, Camera.CFrame* CFrame.new(deltaX, deltaY, -2000).p)
local offset = LowT.CFrame:ToWorldSpace(CFrame.new(0, HighT.Size.Y/2, 0)) * CFrame.fromEulerAnglesXYZ(math.max(math.min(math.asin((M.Hit.p - M.Origin.p).unit.y), .6), -.75), 0, 0) * CFrame.new(0, HighT.Size.Y/2, 0)
waist.C1 = offset:inverse() * LowT.CFrame * CFrame.new(0, .8, 0)
local tweenInfo = TweenInfo.new(.05, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local newRootCF = CFrame.new(root.CFrame.p,root.CFrame.p+Vector3.new(Camera.CFrame.lookVector.X,0,Camera.CFrame.lookVector.Z))
local tween = ts:Create(root, tweenInfo, {["CFrame"] = newRootCF}, true)
tween:Play()
end
end)