Im trying to create a shockwave effect, and have it launch over to where the mouse is facing. But the cloned part(Shockwave part) stays where my HumanoidRootPart is, and it only increases in size. I couldn't figure out how to fix this issue:
local event = script.Parent:WaitForChild("MoveQEvent")
event.OnServerEvent:Connect(function(player, mouse, HRP)
print(mouse)
print(HRP)
local rep = game:GetService("ReplicatedStorage")
local shock = rep:WaitForChild("Shockwave")
local clone = shock:Clone()
clone.Parent = game.Workspace
clone.Position = HRP.Position
local BV = Instance.new("BodyVelocity", clone)
BV.MaxForce = Vector3.new(1e8,1e8,1e8)
BV.Velocity = (mouse - HRP.Position)*500
clone.CFrame = CFrame.new(clone.Position, mouse)
game:GetService("TweenService"):Create(clone, TweenInfo.new(10), {Size = Vector3.new(100,1,100)}):Play()
end)
mouse = mouse.Hit.p and The shockwave part is a MeshPart

1 comment
thanks! i unanchored the part in the script and it worked.