Hello this is my first post, i nead some help.
I want to build simple NPC car (NPC ride it player cant) with stearing to points.
One wheel at back is power wheel, foward wheels are connected with servos to car,
i nead to get them to some angle to move to points (like real car).
Dont wory i tested model while manual steering it and it mowed where i wanted.
So far i have made car steer with no oscilations and that kind of garbage bugs,
but i cant get it to right angle to steer.
Script that i used:
destination = route[“1”]
local dy = y2 - y1
local dz = z2 - z1
local angle =math.deg( math.atan2(dy, dz))
script.Parent.HingeConstraint.TargetAngle=angle script.Parent.HingeConstraint2.TargetAngle=angle print(angle)
Script works well to some point but then i get this:
If you can help, please help me…
Sorry for broken English…