Ok, I am trying to Tween a bullet from the position of a gun to the mouse hit position but when I click the bullet just stays frozen inside of the handle without any errors. Please help, thank you.

    --Variables

local player = game.Players.LocalPlayer

local bullet = game:GetService("ReplicatedStorage"):WaitForChild("Bullet")

local handle = script.Parent

local tool = script.Parent.Parent

local remote = script.Parent:WaitForChild("RemoteEvent")

local tweenSer = game:GetService("TweenService")

  

--Firing function

tool.Equipped:Connect(function(mouse)

mouse.Button1Down:Connect(function(Hit)

local ray = Ray.new(

handle.CFrame.p,

(mouse.Hit.p - handle.CFrame.p).unit * 500

)

local garbage = player

remote:FireServer(ray, garbage)

--tween

local bullet2 = bullet:Clone()

bullet2.CanCollide = false

bullet2.Anchored = true

bullet2.Parent = game.Workspace

bullet2.CFrame = CFrame.new(handle.Position, mouse.Hit.p)

local tweenInfo = TweenInfo.new(1)

local partProperties = {}

partProperties.CFrame = mouse.Hit

local tween = tweenSer:Create(bullet, tweenInfo, partProperties)

tween:Play()

wait(2)

bullet2:Destroy()

end)

end)

2 comments

0

tweenSer:Create(bullet, tweenInfo, {CFrame = mouse.Hit}):Play()

0

i aint no master