Fixed cast exception (maxRangeToTarget is a float)