How to subtract CFrames

Im just trying to know if it’s possible to subtract CFrame values since Im trying to add aiming to my FPS framework and I want it to be as modular as possible. Im pretty much trying to do the equivalent of

Vector3.new(1,1,1) - Vector3.new(1,1,1)

You can do it by inversing the CFrame.

local CFrame1 = CFrame.new(10,0,0)
local CFrame2 = CFrame.new(5,0,0)

print(CFrame1 * CFrame2) -- 15, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 

print(CFrame1 * CFrame2:Inverse()) -- 5, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 

print(CFrame2 * CFrame1:Inverse()) -- -5, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 
12 Likes
(CFrame.new(1,1,1) * CFrame.new(-1,-1,-1)