Weld Constraint Weird Behavior

(I don’t know whether to put this in building support or scripting support)

I am trying to make this cylinder rotate with the neon rectangle welded to it. I am using a weld constraint to attach these two together.
image
The rectangle is not anchored but the cylinder is. Here is a video of the weird behavior


I tried anchoring the rectangle, but the rectangle doesn’t move anymore.

If it helps, this is the script used to rotate the cylinder.

    while true do
        script.Parent.RotVelocity = Vector3.new(0,3,0)
        script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(3,0,0)
        wait(0.1)
     end

Thanks :smiley:

CFrame from Euler angles accepts angles in radians and not degrees, use math.rad(3) to convert to radians. Also use RunService .heartbeat:wait() with delta time for best results like in the CFrame math operations article as it is usually faster than wait() hence more smoother.

Edit: seems like more of a scripting problem, it’s just the CFraming that’s weird.

Yeah, that indeed makes the rectangle move with the cylinder. But is it possible to make the rectangle rotate with the rotvelocity, not the CFrame? I tried removing the weldConstraint, the rectangle now moves with the rotVelocity, but the player can push the rectangle around, which I don’t want.