Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to use CFrame rotation along a fixed part?

Asked by 4 years ago
local firebrick = game.workspace.WaitForChild("firepart")
local pivot = game.workspace.WaitForChild("pivotbrick")

local pivotposition = pivot.Position

while true do
    firebrick.CFrame = CFrame.new(pivotposition) * CFrame.Angles(0, math.rad(i), 0) * CFrame.new(-42.5,0,0)
    wait()
end

Here is what I have tried for rotating a part via CFrame.

0
weld them? Fad99 286 — 4y

1 answer

Log in to vote
0
Answered by
SmartNode 383 Moderation Voter
4 years ago

Pre-made CFrames include the rotation automatically.

Get the CFrame of “pivot” and set “firepart” ‘s CFrame as that.

This should copy the exactly position and rotation of “pivot” ‘s

0
Could you elaborate on how to get them? spunkworks 110 — 4y
0
I did, just set firepart’s CFrame to pivot’s CFrame. You can get their CFrame the same way you get their position, for example: local pivot_CFrame = pivot.CFrame SmartNode 383 — 4y
0
Okay, thank you. spunkworks 110 — 4y
0
Be sure to accept this answer if this is the solution! SmartNode 383 — 4y
Ad

Answer this question