Multiply a CFrame's rotation

I need to multiply a CFrame’s rotation with -2. Not add, but multiply.

There’s probably a better way to do this, but this is the only way i can think of.

local CurrentCF = script.Parent.CFrame
local X,Y,Z = CurrentCF:ToOrientation()

local NewCF = CFrame.new(CurrentCF.Position) * CFrame.Angles(X*-2,Y*-2,Z*-2)

script.Parent.CFrame = NewCF

There’s some weird behaviour, but since this doesn’t fix my overall problem i’ll still mark it as a solution
Edit: Nope, it really doesn’t work. You can see this by rotating with the original orientation values (CFrame.Angles(X, Y, Z)) which should give back the original CFrame, but it doesn’t.

Whats the real problem is, the code is provided is working just fine
Ask your question properly XY Problem

The thing is though, I just for the life of me can’t describe what the actual problem is, I just don’t have the right words for it. But just so you know I would ask the real question if I knew what I wanted to ask in the first place

if thats is the real problem, then it was answered.
If that doesnt work for you, at least tell us the expected behaviour and current one

Like I said, I can’t describe the expected behaviour and the current one. I have tested the code again outside my script and it works. For some reason it doesn´t work when I try to apply it to my use case.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.