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 |
|
|
|
| 11 Jan 2014 11:15 PM |
| weld, sines and cosines, while loop. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 11 Jan 2014 11:45 PM |
| Sorry! Not CFrame! Vector3... |
|
|
| Report Abuse |
|
|
jimbot220
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 5830 |
|
|
| 12 Jan 2014 12:03 PM |
| Thank you all for helping me! |
|
|
| Report Abuse |
|
|