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

Rotating a model without it changing its Vector3 position?

I have tried using this code but it moves the Vector3 position of the primary part, so the lightning won't go to the right place, please help

clone.lightning_g:SetPrimaryPartCFrame(CFrame.Angles(0,180,0))

1 answer

✓ Accepted answer

You're setting it to position 0,0,0 because CFrame.Angles() is only the rotation. You can fix this by taking the current CFrame and multiplying the angle onto that CFrame.

Also, you'll have to use math.deg(180) seeing that CFrame.Angles uses Radians instead of Degrees.

You can use the following code.

clone.lighting_G:SetPrimaryPartCFrame(clone.lighting_G.CFrame * CFrame.Angles(0,math.rad(180),0))

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