Driving forces calculation


Not even sure if i’m calculating it correctly…
(Yes I know this is lazy coding)(repost)

Providing the code in text form will likely attract more attention.

I mean it’s only a few lines of code and I forgot how to lua format.

3 backticks, paste the code then another 3 backticks.

local runtime = 0

game:GetService("RunService").Heartbeat:Connect(function(deltatime)
	local v = Vector3.new(script.Parent.AssemblyLinearVelocity.X, 0, script.Parent.AssemblyLinearVelocity.Z).Magnitude
	local centripetalforce = (v^2) * (script.Parent.Mass) * script.Parent.AssemblyLinearVelocity.Y*deltatime
	script.Parent.VectorForce.Force = ((script.Parent.CFrame.LookVector*script.Parent.Mass*200*deltatime) * (script.Parent.CFrame.RightVector*centripetalforce*-1))
end)

Looks like nobody knows a solution.