Some mathematics logic problems

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Right now the function is supose to just return the z axis, and it is supose to, but, when i try to make it send too x axis, it bugs everything i can’t even explain, but its just a math problem, probably.

  2. What is the issue? Have no issues but, i don’t know how to manage it to send x axis too

  3. What solutions have you tried so far? i Did not find nothing about it, sadly. This is the script

local function adjustMarkerOrientation(marker, worldNormal)
	local fixedForward = Vector3.new(0, 0, 1) -- Direção para frente fixa
	local fixedUp = Vector3.new(0, 1, 0) -- Direção para cima fixa (opcional, ajuste se necessário)

	-- Calcule o eixo direito com base na normal do mundo
	local rightDirection = worldNormal:Cross(fixedForward).Unit
	local newUpDirection = rightDirection:Cross(fixedForward).Unit
	local newCFrame = CFrame.fromMatrix(marker.Position, rightDirection, newUpDirection)

	marker.CFrame = newCFrame
end

Thanks for anyone who is trying to help me if this :crying_cat_face: