Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there any way of rotating a part while it is unanchored?

Ok so I have a problem at the minute where I am trying to make a police lightbar with rotating lights. The car has to be unanchored to move about however the lightbar can't function unanchored.

Is there anyway of allowing the part to rotate while being unanchored? I have the script here.

sphere = script.Parent --This means that you have to have the script in the sphere part

  

a = 0

off = 0

  

repeat

sphere.Rotation = Vector3.new( 0, a, 0) --The second value of vector3 is a,

wait(.01) -- we wait .01 seconds,

a = a+13 --a's value increases

until off == 1

3 comments

0

You would have to create a weld betwen the rotating lights and the car

0

I believe that if you add a BodyAngularXYZ Object it will rotate the part. It might be called different but Instance.new the object and parent it to the part.

0

You're not supposed to use "Rotation", use CFrame instead.

1 answer

create a weld for them to stick together without being anchored, u do this by doing the following

local weld = Instance.new("Weld")--creates a weld
weld.Parent = lightbar here--parents it to the lightbar
weld.Part1 = lightpart here--this sticks to part1
weld.Part0 = car part to stick to here--stick it to part0

4 comments

0

you'd have to set the C0 and C1 properties too, fix that

0

no there is no cframe needed since its not a part, its a weld it just got parent and parts, so no

0

those properties r there already

0

wait c0 and c1? its part0 and part1

This discussion is preserved as it was. New answers, comments, and votes are closed.