local model = game.Workspace.Model
while wait() do
local currentCFrame = model:GetPrimaryPartCFrame()
model:SetPrimaryPartCFrame(currentCFrame * CFrame.Angles(0, math.rad(90), 0))
end
change the values to get your desired speed and next time post in #help-and-feedback:scripting-support as that is the appropriate category for your issue.
That’s strange, try debugging to see if the loop runs and double check if you have a primary part set.
local model = game.Workspace.Model
while wait() do
local currentCFrame = model:GetPrimaryPartCFrame()
print("loop")
model:SetPrimaryPartCFrame(currentCFrame * CFrame.Angles(0, math.rad(90), 0))
end
[Model:GetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.]
Isn’t a PrimaryPart the ones you generate by clicking the Insert > Part at the top of the Home tab-bar? If not what would be considered one?
A model has a “PrimaryPart” Property, It is what the model moves and rotates relative to.
What you want to do is, if you want to make sure you have a part at the very centre of your “beam” (around where it’s going to rotate) , put that part in the model and set the primarypart of the model to that newly made part, Make sure the primarypart is anchored.
The primarypart is not an object. it’s a property.
Okay. I grouped all the Parts that create the 4 beams in the picture and created one model out of them.
Then I added this script inside of the model parent:
workspace.Model.PrimaryPart = workspace.Model.Center
local model = game.Workspace.Model
while wait() do
local currentCFrame = model:GetPrimaryPartCFrame()
print("loop")
model:SetPrimaryPartCFrame(currentCFrame * CFrame.Angles(0, math.rad(90), 0))
end
It gives me these errors from last time:
15:57:07.940 - ContentProvider:PreloadAsync() failed for rbxthumb://type=Asset&id=183435411&w=150&h=150
15:57:07.942 - ContentProvider:PreloadAsync() failed for rbxthumb://type=Asset&id=181701651&w=150&h=150
15:57:07.943 - ContentProvider:PreloadAsync() failed for rbxthumb://type=Asset&id=187789986&w=150&h=150
15:57:07.956 - ContentProvider:PreloadAsync() failed for rbxthumb://type=Asset&id=185687363&w=150&h=150
15:57:07.957 - ContentProvider:PreloadAsync() failed for rbxthumb://type=Asset&id=187790284&w=150&h=150
15:57:07.957 - ContentProvider:PreloadAsync() failed for rbxthumb://type=Asset&id=182451181&w=150&h=150
Yes I have, but do you want the model to only have one Part of the beam or both? The Part that I have selected as the PrimaryPart is the closest to the center circle.
It works just fine for me, I’ve changed the script slightly:
workspace.Model.PrimaryPart = workspace.Model.Center
local model = game.Workspace.Model
while wait() do
local currentCFrame = model:GetPrimaryPartCFrame()
print("loop")
model:SetPrimaryPartCFrame(currentCFrame * CFrame.Angles(0, .1, 0))
end
--change the ".1" if it's too fast or too slow.