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 » Scripting Helpers
Home Search
 

Re: Humanoid Walking in a Circle

Previous Thread :: Next Thread 
TheNickmaster21 is not online. TheNickmaster21
Joined: 04 Oct 2008
Total Posts: 9490
01 Jan 2014 09:57 PM
So, I have two really nooby questions...


First, is walk speed a measure of studs moved every seconds or what?


Second, if I want a humanoid to walk in a circle, I would need something like this:


local x,y = 0,0
Radius = 5

while LoopYolo do
Hum:MoveTo(Vector3.new(math.sin(x)*Radius,0,math.cos(y)*Radius)
end

Right?
Report Abuse
Saiose is not online. Saiose
Joined: 06 Sep 2013
Total Posts: 5759
01 Jan 2014 10:00 PM
First question, yes.

Second question, I think idc
Report Abuse
TheNickmaster21 is not online. TheNickmaster21
Joined: 04 Oct 2008
Total Posts: 9490
01 Jan 2014 10:18 PM
Thanks. I'm about to text the second part.
Report Abuse
TheNickmaster21 is not online. TheNickmaster21
Joined: 04 Oct 2008
Total Posts: 9490
01 Jan 2014 10:33 PM
This worked:

local c = 0
local Radius = 50
while true do
wait(.5)
script.Parent.Humanoid:MoveTo(Vector3.new(math.sin(c)*Radius,0,math.cos(c)*Radius),game.Workspace.BasePlate)
print(math.sin(c)*Radius .. ":" .. math.cos(c)*Radius)
c = c + math.pi*.1
end
Report Abuse
noah98 is not online. noah98
Joined: 12 Jan 2008
Total Posts: 55
01 Jan 2014 10:35 PM
tell him to stop if he's human it should work
Report Abuse
dogwarrior24 is not online. dogwarrior24
Joined: 10 Nov 2010
Total Posts: 1401
01 Jan 2014 10:41 PM
while wait(0.05) do
for i = 1,360 do
wait(0.05)
Pos = CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(i),0)
*CFrame.new(0,0,30) -- Replace 30 with the distance u want them to walk around
script.Parent:MoveTo(Pos.p,Workspace.Baseplate)
end
end
Report Abuse
Wakarimasu is not online. Wakarimasu
Joined: 12 Nov 2013
Total Posts: 1448
01 Jan 2014 11:12 PM
You could use quarterions (spelling?)

People sometimes use those (though rarely in place of RocketPropulsion) to make orbits
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 Jan 2014 12:30 AM
Well normally, every point on a circle is cos, sin but since it's a complete circle, using sin, cos actually doesn't matter.

Just keep that in mind if future scripts using sin and cos may not work
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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