I have never made a tornado, but I did at one time, make a giant toilet that made the players rotate around like a whirlpool if they were in the bowl when it flushed.
The way I did it, was to have a series of points, sort of in a ever tightening spiral as it moved down, and I would just use body movers (although now I would use AlignPosition) to move the players to each node.
However, if I were to re-do it, I would probably just use a mathematical formula, probably some sin and cos to move them with AlignPosition in a spiral motion.
you could make an invisible box around the tornado that carries false collisions so that when a player touches it then drag it spinning to the center, you could spin with Cframe.Angles from the HumanoidRootPart and also make it Cframe to the center or somew
here
I already have all the player’s HumanoidRootPart. I just need a function that pulls them toward the tornado with a force that increases the closer the player is to the tornado and then spirals the player up
CFrame.fromEulerAngles((tornadoPosition - playercharacterPosition).Unit) * CFrame.Angles(0,3,0)
Calculating the Vector3 force required to bring the player directly to the tornado, and then slightly turning the Vector3.
How I imagine this would work is get the difference in CFrame from the player and the Tornado, we’ll call this Diff we’ll also store some distance data.
Diff = TornadoCFrame * Player.CFrame:Inverse()
CurrentDist
MaxDist = 300--maximum distance from the tornado
MinDist = 15--eye of the storm
Then we offset that CFrame to get our next desired position.
We’ll call this NextCFrame
Next we need to calculate a direction to go FLING!
We’ll call this Fling it requires a few steps to set up
MaxPower = 300
FlingAngle = CFrame.new(CharacterPos,NextCFrame.Position).LookVector
FlingDist = (CharacterPos - NextCFrame.Position).Magnitude--how far away?
--get number between 1 and 0 to represent our distance from 15-300
FlingPower = (FlingDist - MinDist)/(MaxDist - MinDist)) -- 'ol reliable (Val - Min)/(Max - Min)
Fling = FlingAngle * (FlingPower*MaxPower)
Then we should be able to apply this velocity to a player!
PrimaryPart.Velocity = Fling
disclaimer: i wrote this all here and is untested incomplete. only conceptual code snippets to get a general idea of how something like this could work
local MaxPower = 300
local MaxDist = 300
local MinDist = 15
function SimulateTornado(tornado)
RunService.Heartbeat:Connect(function()
for _,player in pairs(Players:GetPlayers()) do
local character = player.Character
if not character then continue end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then continue end
local Diff = tornado.Part.CFrame * humanoidRootPart.CFrame:Inverse()
local NextCFrame = tornado.Part.CFrame * CFrame.Angles(0, math.rad(90), 0) * Diff
local FlingAngle = CFrame.new(humanoidRootPart.Position, NextCFrame.Position).LookVector
local FlingDist = (humanoidRootPart.Position - NextCFrame.Position).Magnitude
local FlingPower = (FlingDist - MinDist)/(MaxDist - MinDist)
local Fling = FlingAngle * (FlingPower * MaxPower)
humanoidRootPart.AssemblyLinearVelocity = Fling
end
end)
end