C
C#2y ago
Zenternion

❔ UNITY Vector3 not applying

int cPop = Mathf.RoundToInt(((tCity.POP_MIN + tCity.POP_MAX) ?? 0) / 2.0f); //tCity just holds the data of the city

Object cityToUse;

float popMult;
if (cPop <= 500000 && cPop > 0)
{cityToUse = cityTo500K; popMult = cPop / 1000000;}
else if (cPop <= 1000000 && cPop > 500000)
{cityToUse = cityTo1M; popMult = cPop / 1000000;}
else if (cPop > 1000000)
{cityToUse = cityToRest; popMult = (cPop / 10000000) + 1;}
else
{cityToUse = cityTo500K; popMult = 0.3f;}//

if (popMult < 0.3) popMult = 0.3f;

//other code
//........

Vector3 multiplier = new Vector3(popMult * shapeSettings.radius, popMult * shapeSettings.radius, popMult * shapeSettings.radius);
do {
cityMeshGameObject.transform.localScale = multiplier;
} while(cityMeshGameObject.transform.localScale != multiplier);
int cPop = Mathf.RoundToInt(((tCity.POP_MIN + tCity.POP_MAX) ?? 0) / 2.0f); //tCity just holds the data of the city

Object cityToUse;

float popMult;
if (cPop <= 500000 && cPop > 0)
{cityToUse = cityTo500K; popMult = cPop / 1000000;}
else if (cPop <= 1000000 && cPop > 500000)
{cityToUse = cityTo1M; popMult = cPop / 1000000;}
else if (cPop > 1000000)
{cityToUse = cityToRest; popMult = (cPop / 10000000) + 1;}
else
{cityToUse = cityTo500K; popMult = 0.3f;}//

if (popMult < 0.3) popMult = 0.3f;

//other code
//........

Vector3 multiplier = new Vector3(popMult * shapeSettings.radius, popMult * shapeSettings.radius, popMult * shapeSettings.radius);
do {
cityMeshGameObject.transform.localScale = multiplier;
} while(cityMeshGameObject.transform.localScale != multiplier);
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.