generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Make player run around in a circle?

Previous Thread :: Next Thread 
Dorandir is not online. Dorandir
Joined: 06 Aug 2016
Total Posts: 844
19 Apr 2017 02:08 PM
Hello! I want to make my player to be forced to run around in a circle, but I'm unsure how to get the circular points he would run to. I know it has something to do with pi right?

Center = HumanoidRootPart.Position

for i = 1 , 36 do
Humanoid:MoveTo(Center + Vector3.new(???))
wait(0.5)
end
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
19 Apr 2017 02:13 PM
nextPoint = part.CFrame*CFrame.Angles(0, 0, math.rad(1)) + Vector3.new(0, 0, radius)
?

I guess alternate between axis according to the 3D space you're working in.


#code --This validates my comment.
Report Abuse
Dorandir is not online. Dorandir
Joined: 06 Aug 2016
Total Posts: 844
19 Apr 2017 02:24 PM
But MoveTo is for Vector3? How can I use that with Vector3?
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
19 Apr 2017 02:28 PM
get the CFrame.p calculated by the new point. idk


#code --This validates my comment.
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
19 Apr 2017 02:29 PM
part being the centre of the circle btw.


#code --This validates my comment.
Report Abuse
Dorandir is not online. Dorandir
Joined: 06 Aug 2016
Total Posts: 844
19 Apr 2017 02:31 PM
I tried this and it took me to the same spot each time. ####### ###### = HumanoidRootPart.CFrame.p ############### + Vector3.new(0, 0, 6) for i = 1, 36 do Humanoid:MoveTo((CFrame.new(Center) * CFrame.Angles(0, 0, math.rad(i * 10)) + Vector3.new(0, 0, 6)).p) wait(1) end
Report Abuse
Dorandir is not online. Dorandir
Joined: 06 Aug 2016
Total Posts: 844
19 Apr 2017 02:34 PM
GOT IT! ####### ###### = HumanoidRootPart.CFrame.p ############### + Vector3.new(0, 0, 6) for i = 1, 36 do Humanoid:MoveTo((CFrame.new(Center) * CFrame.Angles(0, math.rad(i * 10), 0) * CFrame.new(0, 0, 6)).p) wait(.1) end
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
19 Apr 2017 02:36 PM
I'll try and write something out one sec.

local part = script.Parent
local nextPoint
local radius = 5
local degreesInACircleBecauseROBLOXFilterDoesntLikeMe = 360

for i = 1, degreesInACircleBecauseROBLOXFilterDoesntLikeMe do
nextPoint = part.CFrame*CFrame.Angles(0, i, 0) + Vector3.new(0, 0, radius)
humanoid:MoveTo(nextPoint)
end

I just wrote that out withou... without putting in enough effort, so you might need to change it or something idk but hopefully I've explained the concept to you.


#code --This validates my comment.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image