Hello, So how would I makea part spin around another part but always 5 studs away from that part? this is for a smallidea of mine and any help is welcome.
Thanks for reading.
Hello, So how would I makea part spin around another part but always 5 studs away from that part? this is for a smallidea of mine and any help is welcome.
Thanks for reading.
If you meant to have a part spin around a radius of 5 studs, then there are multiple approaches to this idea, depending on what works and whatnot.
One idea is to use physics to do it, with the assembly of parts being an anchored center, an anchored “target” part and an unanchored “satellite”. The satellite would only need to follow the target part via constraints. This requires only minimal scripting.
Another approach is CFraming or Tweening. The latter is much smoother in comparison to pure CFraming but may cause a different behavior apart from CFraming. Same thing as above except there is no unanchored part.
local yourpart = workspace.Part -- The part that it spins around from
local secondpart = workspace.two -- The part you want to spin
local Rotation = 0
local Distance = 5
while true do
task.wait()
secondpart.CFrame = CFrame.new(yourpart.Position)*CFrame.Angles(0,Rotation,0)*CFrame.new(Distance,0,0) -- You can choose which axis you want it to be offset from
Rotation += 0.05
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.