Hello all, I’m trying to do some simple math in a script and then output those numbers. However, the value that is output is always 0 for some reason.
I’ve triple checked the math and there seems to be no problem with it so I am stumped. Below is the code.
float carMaxRPM = 8000f;
int numberOfPoints = 20;
List<float> listOfPoints;
void CalcPoints(){
for (int i = 0; numberOfPoints > i; i++)
{
//RPM point is generated based on amount of points for the graph.
var rpmPoint = carMaxRPM * (i / numberOfPoints);
listOfPoints.Add(rpmPoint);
}
}
Any help? I’ve also tried using Mathf.Lerp(0, carMaxRPM, i/numberOfPoints); but it still returns 0, so I feel I’m doing something very wrong.