I have a private double which I want to divide by 360 and then use as angle.
Problem is quaternions need floats, it doesn’t work with double.
Any help on how to achieve this?
Thanks in advance.
I do not use C# but you could try:
float variable = (float)yourDoubleVariable;
Edit: Information for other reader:
UnityScript allows to cast without any typecasting like
will work and the conversion will simply truncate the result, not round so 1.9 becomes 1.
P.S:For those of you wondering how to use larger data than float in UnityScript you need to include the System.
var aDouble : System.Double;
var aBigInt : System.Int64;