Localscript cannot rotate parts created by server

I’m working on rotating 2 shields which are unions around a character. The current problem I’m encountering is that the local script will update the union’s position to the character but won’t rotate no matter what I’ve tried. I don’t know if this is a Roblox error or my own.
The part is anchored and is parented to a folder within the workspace.

Properties tab showing the orientation is changing although it visibly does not.
EMTIEARseA

Code:

game:GetService("RunService").RenderStepped:Connect(function()
	for i = 1,360 do
		LS.CFrame = CFrame.new(Character.HumanoidRootPart.Position)
		LS.Orientation = Vector3.new(-90, -90, i) --Rotates the shield around the character
		RS.CFrame = CFrame.new(Character.HumanoidRootPart.Position) 
		RS.Orientation = Vector3.new(-90,-90,i+180) --Changes the second shield to rotate 180 from the first shield
		wait()
	end
end)
1 Like

Instead of using Orientation, use CFrame.Angles. Also, it’s only going to be visible on the client and the server won’t see the updates to the rotations because you’re running the code on the client without being replicated to the server.

Also, why are you using a for loop inside the RenderStepped loop? That doesn’t really make sense because it’s going to run forever regardless.

1 Like

That for loop is running at 60/s (the rate of RenderStepped), which means it’ll try to start over 60 times per second. You should be updating the angle each step and then applying it accordingly, as seen here:

local angle = 0

game:GetService('RunService').RenderStepped:Connect(function()
    angle = angle + 0.1

    LS.CFrame = (CFrame.new(Character.HumanoidRootPart.Position) * CFrame.Angles(0, math.rad(angle), 0)) * CFrame.new(0, 0, -6)
    RS.CFrame = (CFrame.new(Character.HumanoidRootPart.Position) * CFrame.Angles(0, math.rad(angle), 0)) * CFrame.new(0, 0, 6)
end)
2 Likes

this is old but shouldn’t you tween it instead of using a loop ?

no RenderStepped runs every frame depending on the client frame rate you can see that here