Hey, So I made a catching system that allows you to track a footballs position as its in the air but there’s a problem I don’t like about it. When you click it looks like your arms are teleporting instead of following the ball and I wanted to fix that so your arms follow it smoothly. I don’t really know how to do that. I’ve tried doing it work TweenService but it didn’t go as plan. Please help.
Code:
local Player = game:GetService( 'Players' ).LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Torso = Character:WaitForChild( 'Torso' )
local RightArm = Character:WaitForChild('Right Arm')
local LeftArm = Character:WaitForChild('Left Arm')
local Instances = Character:WaitForChild( 'Instances' )
local Mouse = Player:GetMouse()
local Remote = game.ReplicatedStorage.Remotes:WaitForChild('CRemote')
local CDebounce = false
local Football = nil
local function DestroyWelds1(Child)
if Child.Name == "Football" then
-- Delay --
task.wait(1)
local RAWeld = Instances:FindFirstChild("RAW")
local LAWeld = Instances:FindFirstChild("LAW")
-- Destroy --
if RAWeld and LAWeld then
RAWeld:Destroy()
LAWeld:Destroy()
end
end
end
local function DestroyWelds2(Child)
if Child.Name == "Football" then
local RAWeld = Instances:FindFirstChild("RAW")
local LAWeld = Instances:FindFirstChild("LAW")
-- Destroy --
if RAWeld and LAWeld then
RAWeld:Destroy()
LAWeld:Destroy()
end
end
end
local function Catch()
if CDebounce == false then
CDebounce = true
if Character:FindFirstChild('Football') then return end
if workspace:FindFirstChild('Football') then
-- Instances --
local RAWeld = Instance.new("Weld")
local LAWeld = Instance.new("Weld")
-- Data --
RAWeld.Name = "RAW"
RAWeld.Part0 = Torso
RAWeld.Part1 = RightArm
RAWeld.Parent = Instances
LAWeld.Name = "LAW"
LAWeld.Part0 = Torso
LAWeld.Part1 = LeftArm
LAWeld.Parent = Instances
-- Move Arms --
for i = 1, 45 do
Remote:FireServer(true)
local RCFrame = CFrame.new(Torso.CFrame * Vector3.new(1.2, 1.1, 0), workspace.Football.Handle.Position) * CFrame.Angles(math.pi / 2, 0, 0)
local LCFrame = CFrame.new(Torso.CFrame * Vector3.new(-1.2, 1.1, 0), workspace.Football.Handle.Position) * CFrame.Angles(math.pi / 2, 0, 0)
RAWeld.C0 = Torso.CFrame:toObjectSpace(RCFrame) * CFrame.new(0, -.7, .6)
LAWeld.C0 = Torso.CFrame:toObjectSpace(LCFrame) * CFrame.new(0, -.7, .6)
task.wait(2 / 45)
Remote:FireServer(false)
end
if RAWeld and LAWeld then
RAWeld:Destroy()
LAWeld:Destroy()
end
wait(0.8)
CDebounce = false
end
end
end
Mouse.Button1Down:Connect(Catch)
Character.ChildAdded:Connect(DestroyWelds1)
Character.ChildRemoved:Connect(DestroyWelds2)