I am making a puck that gets blasted once it is hit by the player. The script that I have now makes it blast in the direction the player is looking which works great if it is a straight on contact but most of the time the puck is being hit by the side of the player. Is there a way I could send it in the direction where the contact between the player and puck happened instead of using the player’s look vector? Below is my script.
local part = script.Parent
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent:FindFirstChild("Humanoid")
local plr = game.Players:GetPlayerFromCharacter(hum.Parent)
local HumanoidRootPart = hit.Parent.HumanoidRootPart
local velocity = Instance.new("BodyForce", part)
velocity.Parent = part
velocity.Force = HumanoidRootPart.CFrame.LookVector * Vector3.new(200 * plr.HitPower.Value, 20, 200 * plr.HitPower.Value)
script.Disabled = true
task.wait(2)
script.Disabled = false
velocity:Destroy()
end
end)