I am trying to make a spell were the user shoots a ball that explodes on impact. My problem is that the explosion happens at the wrong place. When it hits, the blast happens where the ball was about a tenth of a second ago. It happens at between my character and the point of impact instead of happening at the point of impact. I even see it go farther but the explosion happens at the wrong place. It should happen right at the point of impact
script.Parent.EnergyBall.Touched:Connect(function(Hit)
local Pos = script.Parent.CFrame.Position
local Caster = script.Parent.Caster.Value
if Hit.Parent == Caster or Hit.Parent.Parent == Caster or not script.Parent:FindFirstChild("BodyVelocity") then
return
end
script.Parent:Destroy()
local Blast = game:GetService("ServerStorage").EnergyBallBlast:Clone()
Blast.Parent = workspace.Spells
local Humanoid = Hit.Parent:FindFirstChildWhichIsA("Humanoid") or false
if Humanoid then
Humanoid:TakeDamage(20)
end
if Hit.Name == "Handle" and Hit.Parent:IsA("Accessory") and Humanoid then
Hit.Parent.Parent = nil
Hit.Parent.Parent.Parent.Humanoid:TakeDamage(91)
end
Blast.Position = Pos
Blast.Caster.Value = Caster
Blast.EnergyBallBlast.Position = Blast.Position
Blast:WaitForChild("Collision").Position = Blast.Position
Blast.Caster.Value = Caster
end)
