local CFrameA = -- CFA
local CFrameB = -- CFB
local Dot = math.acos(CFrameA.LookVector:Dot(CFrameB.LookVector))
print(math.rad(Dot)) -- prints orientation related difference in angles.
-- For Positional:
local Distance = (CFrameA.Position-CFrameB.Position).Magnitude
print(Distance)
-- Defines the parts
local Red = workspace.Red
local Black = workspace.Black
local Blue = workspace.Blue
-- Loops
while true do
-- Gets the positions X and Z from each part
local X = Blue.Position.X
local Z = Red.Position.Z
-- Sets the position X and Z to the black position
Black.Position = Vector3.new(X,0.5,Z)
-- Waits a little bit for you pc not exploding
wait()
end
local red = -- red part
local black = -- black part
local blue = -- blue part
local z = Red.Position.Z
blue.Changed:Connect(function()
local x,y = blue.Position.X,black.Position.Y
black.Position = Vector3.new(x,y,z)
end)
For @JESUS5PACHECO Using while loops can cause a lot of ping issues, its better to use .Changed Events.
so what u showed me was close to what i wanted but
if you select all the parts and did ctrl+r
and have that script run
the black part will be positioned differently and not the same before you rotated it