Vector3.Angle giving a weird result

i am having kind of a weird problem with the Vector3.Angle function. it seems to give me a wrong result.
for example,look at this code :

//update forward vectors
		carForward  = car.transform.forward;
		camForward  = cam.transform.forward;
		camForward.y = 0;
		
		// calculate the angle between the car's forward vector and the camera's forward vector
		float carCamAngle = Vector3.Angle(carForward,camForward);
		Debug.Log(carCamAngle);
		Debug.Log(carForward);
		Debug.Log(camForward);

in this code,camForward and carForward are vector3 variables that are equal to (0,0,1). yet,after i use Vector3.Angle with these two variables the result i get is 1.705021,when clearly i should be getting a zero

i can’t really figure what i did wrong there. has anyone got any idea?

When you Debug.Log, output the components of the vectors instead. If memory serves (which it usually doesn’t in my case), if you just try to convert a vector to a string, it will round/clamp the values to the nearest integer (I don’t know why)

Debug.Log("Car: " + carForward.x + ", " + carForward.y + ", " + carForward.z);

Perhaps the vectors aren’t actually (0,0,1), but one is a bit off.

what do you know,you were right! thanks :'D

WAT

Glad I could help!