Hey guys i really need your help! I got a converting script which converts Numbers like 1.000.000 to 1 Million. But when i try to add a new number higher than Quintillion it says “Integral constant is too large”. (trying to make a clicking game) how can i make my number higher than Quintillion?
Thanks for your Help, here is the script:
public class CurrencyManager : MonoBehaviour {
private static CurrencyManager instance;
public static CurrencyManager Instance {
get {
return instance;
}
}
void Awake()
{
CreateInstance ();
}
void CreateInstance(){
if (instance == null) {
instance = this;
}
}
public string GetCurrencyIntoString(float valueToConvert, bool currencyPerSec, bool currencyPerClick ){
string converted;
if (valueToConvert >= 1000000000000000000000)
{
converted = (valueToConvert / 1000000000000000000000f).ToString("f3") + " SEX";
}else if (valueToConvert >= 1000000000000000000) {
converted = (valueToConvert / 1000000000000000000f).ToString ("f3") + " QUI";
} else if (valueToConvert >= 1000000000000000) {
converted = (valueToConvert / 1000000000000000f).ToString ("f3") + " QUA";
}
else if (valueToConvert >= 1000000000000) {
converted = (valueToConvert / 1000000000000f).ToString ("f3") + "T";
}
else if (valueToConvert >= 1000000000) {
converted = (valueToConvert / 1000000000f).ToString ("f3") + "B";
}
else if (valueToConvert >= 1000000) {
converted = (valueToConvert / 1000000f).ToString ("f3") + "M";
}
else if (valueToConvert >= 999) {
converted = (valueToConvert / 999f).ToString ("f3") + "K";
}
else if (valueToConvert <= 1000)
{
converted = Mathf.Round(valueToConvert).ToString();
}
}

You need to remember that unity is 3D engine. transform.LookAt(target, Vector3.up) does work, put in update() switch editor to 3D mode and drag around your object in play mode. You'll see how it's rotating. As for solution, put your script on empty object, put inside that object another object with bullet sprite and rotate that sprite -90 on Y axis. (With default unity set up, LookAt(target, Vector3.up))
– prof