Get the direction of an AI Character

How can I get the direction of a moving GO?
If I use the Input, I will get values between -1 and 1 for Side and Forward.
But how can I get those values of an AI?
If I use the last position and current position and divide it by Time.deltatime, I get awful values… for example if my AI goes constantly right, I get a list of values like this: 0.13514, 0.41245, 0.63456, -0.14833 and so on…
All I want is to get values between -1 and 1 and to be constant, not like those above.

gameObject.transform.forward will return the Vector3 normalized direction. If you’re only rotating around the y axis, then only the x and z values will be populated, which you can use sin and cosine to calculate an angle if you like.