Answer the question
In order to leave comments, you need to log in
How to change the scale of an object by equal parts depending on the number?
How to resize an object by equal fractions depending on the original number.
An object has an initial number on which it must depend.
For example, if int Number is initially given, then the scale value is bound to that number.
For example, for x scale = 5 and number = 5, if number = 4, then scale should also be equal to 4 and so on up to 0, how is this done?
But it must not exceed a certain number, for example, 10.
If number is initially equal to 20, then scale must still not exceed 10. If number is 18, then scale must be equal to 9, etc.
I started doing this:
public GameObject KakoitoObject;
public int Number;
if (Number = 5)
{
KakoitoObject.transform.localScale = new Vector3 (5,0,0) ;
}
if (Number = 4)
{
KakoitoObject.transform.localScale = new Vector3 (4,0,0) ;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question