Im trying to make a kamehameha but when i use touch interest its laggy, region3 is glitchy and hits player when beam dont even hit them, and i dont know how to use magnitude so it gets the size of the beam. I also tried :gettouchingpart() but u have to have cancollide = true and players dont go in beam
Heres the code
start1 = script.Parent end1 = script.Parent.Part function castRay() local ray = Ray.new( start1.Position, -- origin (end1.Position - start1.Position).unit * (200) -- direction ) local ignore = game.Players.LocalPlayer.Character local hit, position = workspace:FindPartOnRay(ray, Player.Character, false, true) if hit then if hit.Parent:FindFirstChild("Humanoid") ~= nil then damage = Player.Data.Level.Value humanoid = hit.Parent:FindFirstChild("Humanoid") torso = hit.Parent:FindFirstChild("LowerTorso") humanoid.Health = humanoid.Health - damage*10 body = Instance.new("BodyVelocity",torso) body.Velocity = root.CFrame.lookVector*10 game.Debris:AddItem(body,0.1) end end end