I have a method, in wich i am using the Cos() Funcion from the namepace "Mathf".
Sadly, when i give , for exaple the in put of 45 it returns 0,52532, wich is wrong. Using a calculator i get the correct answer of 6.283185 Radiants.
float angle = 45;
Debug.Log(Mathf.Cos(angle));
Prints out:
0,525322
Can anyone help me out here? I am very confused right now
>Solution :
You need to convert to radians.
float angle = 45;
Debug.Log(Mathf.Cos(angle * Math.PI / 180.0f));