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: CIRCULAR MOTION?

Previous Thread :: Next Thread 
jimbot220 is not online. jimbot220
Joined: 23 Jul 2011
Total Posts: 5830
11 Jan 2014 11:03 PM
i want a part to move in a circular motion, how?
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
11 Jan 2014 11:15 PM
weld, sines and cosines, while loop.
Report Abuse
haloisabeast is not online. haloisabeast
Joined: 28 Jun 2009
Total Posts: 366
11 Jan 2014 11:44 PM
Use Cframe!

also a general understanding of circles and circular equations would be helpful...

part = script.Parent
centerx = part.Position.X
centerz = part.Position.Z
yval = part.Position.Y
radius = 5 -- change to make circle bigger/smaller
angle = 0

--[[ math stuff (in case you're interested):
(x-Cx)^2 + (y-Cz)^2 = r^2
x-0)^2 + (y-23.6)^2 = 25
sin = opp/hyp, y/hyp, 0/5 = 0, sin = y/r
sin(math.rad(angle)) = y/r
arcsin(y/r) = math.deg(angle)
angle = 0
what is y and x?
sin(math.rad(0) = y/5
5*sin(math.rad(0)) = y
5*cos(math.rad(0)) = x
]]--

while true do
angle = angle + 1 -- make bigger to go faster
wait()
part.Position = Vector3.new(((radius*math.cos(math.rad(angle)) )+ centerx), yval, ((radius*math.sin(math.rad(angle))) + centerz))
end


*Wherever you place the brick will be the center of the circle it rotates in.
Report Abuse
haloisabeast is not online. haloisabeast
Joined: 28 Jun 2009
Total Posts: 366
11 Jan 2014 11:45 PM
Sorry! Not CFrame! Vector3...
Report Abuse
jimbot220 is not online. jimbot220
Joined: 23 Jul 2011
Total Posts: 5830
12 Jan 2014 12:03 PM
Thank you all for helping me!
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