Problem with Doors

Hi I have a problem with the doors
my code:

local door2_pos = script.Parent.Door2.CFrame + Vector3.new(0,0,5)
local door1_pos = script.Parent.Door1.CFrame + Vector3.new(0,0,-5)

here is a screenshot of what my problem is
Red is what is happening
Green is what I want

Either

local door2_pos = script.Parent.Door2.CFrame * CFrame.new(0,0,5)
local door1_pos = script.Parent.Door1.CFrame * CFrame.new(0,0,-5)

or

local door2_pos = script.Parent.Door2.CFrame * CFrame.new(5,0,0)
local door1_pos = script.Parent.Door1.CFrame * CFrame.new(-5,0,0)

should fix this. The reason why Vector3.new() doesn’t work is because it uses the global space but with * CFrame.new() it now uses the local space that you referenced first with script.Parent.Door2.CFrame since cframe consists of position and orientation at the same time.

Try checking out .RightVector

To get LeftVector, simply just negate the RightVector

Also, to get 5 or -5, multiply RightVector by 5

RightDoor.CFrame = DoorFrame.CFrame * (DoorFrame.CFrame.RightVector * 5)
LeftDoor.CFrame = DoorFrame.CFrame * (-DoorFrame.CFrame.RightVector * 5)

Thank you now is working very well I never can understand CFrame. Have nice day