So I'm trying to make a Spell.Everything works but the spell doesnt move correctly. Please help.
local slash = game.ReplicatedStorage.Slash local root = script.Parent.HumanoidRootPart local view = root.CFrame.LookVector script.RemoteEvent.OnServerEvent:Connect(function() local clone = slash:Clone() clone.CFrame = root.CFrame clone.Position = root.Position clone.Parent = workspace clone.BodyVelocity.Velocity = Vector3.new(view * 250) end)
this is inside a script. I just need it to move correctly.
1.Instead of Vector3.new(view * 250) Use root.CFrame.LookVector
Script:
local slash = game.ReplicatedStorage.Slash local root = script.Parent.HumanoidRootPart local view = root.CFrame.LookVector local distance_in_studs = 100 script.RemoteEvent.OnServerEvent:Connect(function() local clone = slash:Clone() clone.CFrame = root.CFrame clone.Position = root.Position clone.Parent = workspace clone.BodyVelocity.MaxForce = Vector3.new(5000,5000,5000) clone.BodyVelocity.Velocity = root.CFrame*(root.CFrame.LookVector*distance_in_studs) end)