I am trying to make a tornado damage script and it works (kind of) but all parts hit by a tornado go to the same spot and I don't know how I could fix this even by looking at multiple CFrame tutorials. pls help pretty pls
video showing problem: https://streamable.com/cbfs9m
code:
local tornado = script.Parent
local tornadoOffset = CFrame.new(0, 0, tornado.Position.Z * 10)
tornado.Touched:Connect(function(hit)
if hit.Name ~= "Baseplate" then
hit.Anchored = false
local damage = Instance.new("BodyPosition", hit)
damage.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
while wait() do
damage.Position = tornado.CFrame:ToWorldSpace(tornadoOffset).p
end
end
end)

1 comment
Omg even better than my solution lol thank you so much! I kind of understand the math but I shall look into it more, thank you again