a projectile that i am trying too shoot falls on my head when I shoot it at a wall. shooting at nothing works fine.
https://gyazo.com/90441ec262916cbbd19e76cc27157d42
mouse position fired from localscript
local shadow = game.ServerStorage.MAGICKS:WaitForChild("Shadow")
local shadowDMG = 60
game.ReplicatedStorage.shadowService.OnServerEvent:Connect(function(player, mouse)
local character = player.Character
local newShadow = shadow:Clone()
newShadow.CFrame = character.HumanoidRootPart.CFrame
local shadowVelocity = Instance.new("BodyForce")
shadowVelocity.Force = (mouse.Position - character.HumanoidRootPart.Position)
shadowVelocity.Parent = newShadow
newShadow.Parent = workspace
local touchCon
touchCon = newShadow.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= player.Name then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - shadowDMG
if touchCon ~= nil then touchCon:Disconnect() end
newShadow:Destroy()
end
end
end)
wait(4)
if touchCon ~= nil then touchCon:Disconnect() end
newShadow:Destroy()
end)
