How could i make it so the wheels turn acordingly?

How would I make the wheels know if they are in front of the center block, and if they are to the right or left? I’ve got a system working, but it only works for the one way that it is facing right now.
Capture_2020_04_02_13_37_19_107
code for that part:

local yes = workspace.WheelIdentifier.Position.X - script.Parent.PrimaryPart.Position.X
local no = workspace.WheelIdentifier.Position.Z - script.Parent.PrimaryPart.Position.Z
local maybe
	if no <0 then
		maybe = true
	end
	if no >0 then
		maybe = false
	end
	if yes <0 and maybe == false then
		TURN_ANGLE = 20
	end
	if yes >0 and maybe == false then
		TURN_ANGLE = -20
	end
	if yes <0 and maybe == true then
		TURN_ANGLE = -20
	end

I have it on a loop.

For a similar problem involving speed, I just put an IntValue inside of each motor with a value of either 1 or -1. The value corresponds to which side of the vehicle the motor is on, then I multiply the speed by that value.

A solution like that could probably be extended to your use-case too.

i use it for a placement system. The wheels could be anywhere on the craft and moved around.


how can i fix it thinking it is turned only one way?

oop, nope, i just figured out how to use :PointToObjectSpace() and applied it here and it worked.