Hi guys!
I’m trying to create dummies walking in circles perfectly kinda.
This is my inspiration: https://cdn.discordapp.com/attachments/1057110072414720151/1139908370908840056/watermark.gif?ex=68cdfea6&is=68ccad26&hm=6853708500dd808ef0d325fe7620bbde655e1f379926420f6bd8102433959916&
I tried at the beginning to created a script for each dummy:
local Mishtachave = script.Parent -- I call them like that, they are the dummy's name
local Humanoid = Mishtachave:FindFirstChildOfClass("Humanoid")
local RootPart = Mishtachave:FindFirstChild("HumanoidRootPart")
if Humanoid and RootPart then
local Radius = 10
local SpeedMcqueen = 5 -- Speed
local Center = RootPart.Position
local Angle = 0
while true do
Angle = Angle + math.rad(SpeedMcqueen)
if Angle > math.pi * 2 then
Angle = Angle - math.pi * 2
end
local TargetPosition = Center + Vector3.new(math.cos(Angle) * Radius, 0, math.sin(Angle) * Radius)
Humanoid:MoveTo(TargetPosition)
Humanoid.MoveToFinished:Wait()
task.wait(0.001)
end
end
It took me a while to write this code, and it looks like this:
How can I make this work, like in the inspiration?
Best, XMLcard