I'm working on a game and i created a "Beam" attack. So, to make the beam grow forward, i used Resize(). The only problem, is that i put a script in the beam in which i used .Touched event. Because of that, the beam wont go throught parts (I tried without and it works but when i use .Touched, it does nothing) . How can i make Resize() continue even if it hits a part ?
Event script :
local beam = script.Parent
beam.Touched:connect(function(part)
if part.Parent:FindFirstChild("Humanoid") then
local humanoid = part.Parent:FindFirstChild("Humanoid")
humanoid:TakeDamage(10)
end
end)
Beam Script
local beam = script.Parent
for i = 1,25 do
beam:Resize(5, 2)
wait(0.01)
end

3 comments
make my answer accepted right now
tween lags in game, for my beam attack I used resize and then i constantly shot out a damage part instead of having the actual beam cause damage
also keep the beam can't collide