Watchtower spotlight rotation fail

I am making a horror game and I have watch tower thingies in it. They have spotlights on top of them, and I want to make them rotate in a specific way. I’ve tried so many things but they’ve all failed, so I’ve came here for help. Anyways, here is the code for the script I am trying to use to get it to automatically rotate:

while true do
	script.Parent.WorldPivot.Rotation.CFrame = script.Parent.WorldPivot.Rotation.CFrame * CFrame.fromEulerAnglesXYZ(0.1,0,0)
	wait()
end

Here is a picture of the model hierarchy:


And here is a video of what I am trying to get it to look like:
video - YouTube

I think it’s CFrame.Rotation not Rotation.CFrame ! :grin:
I hope that was helpful ! :wink:

You can create a local script in StarterCharacterScripts in which you put this :

while true do
	workspace.watchtower1.Spotlight.Rotation = workspace.watchtower1.Spotlight.Rotation + Vector3.new(0,1,0)
	wait()
end

I hope that was helpful ! :grinning:

didnt work and I tried both of the methods

1 Like

It works for me, it’s weird, but however you’re right, I don’t know why at -90 or 90 degrees the part stops the movement…

Did you do it right ?
Bug8

Yeah, i put it in there and i did all ur stuff but it still aint working

Try your script on just a regular block part to test it… if that part spins as desired, then you know your issue lies with your model. If it is with the model, I would check unions first, those can act wierd if you havent unioned them correctly, and cause issues when moving.