Long story short, I made this script
game:GetService("RunService").Heartbeat:Connect(function()
local Part2 = workspace.AttentionPart
local VectorPosition = Part2.Position
local CframeVector = script.Parent.CFrame.Position
local Radian = math.acos(math.clamp(VectorPosition.Unit:Dot(CframeVector.Unit), -1, 1))
local DegreesRAW = Radian * 180/math.pi
local DegreesConverted = math.floor(DegreesRAW)
if DegreesConverted > 90 then
print(tostring(1))
elseif DegreesConverted < -90 then
print(tostring(-1))
elseif DegreesConverted < 90 then
print(tostring(0.5))
elseif DegreesConverted > -90 then
print(tostring(-0.5))
end
end)
I needed to use this to calculate the steering angle needed to turn the car as i am making a car AI system. However, im having issues using angles to set the vehicleSeat’s steer property since instead of using angles, it uses any value between -1 and 1. How can I make this possible?