How to limit the max and minimum number in a input field.
I'm wanting to limit the maximum and minimum number in an input field but I don't know how to do this. How can I do this?
Thank you for any and all help.
I think this can help you what you're trying to achieve
Answer by FeeeshMeister · Aug 18, 2016 at 07:46 PM
Do you mean Mathf.Clamp?
Here is an example,
float Min;
float Max;
float NumberToClamp;
void Update() {
NumberToClamp = Mathf.Clamp(NumberToClamp, Min, Max)
}
This will tell unity, NumberToClamp is equal to NumberToClamp, and should not go below Min, or above Max. Input the variables/numbers you need and this should work.
He was asking about input field and what is there in mathf.clamp
Your answer
Follow this Question
Related Questions
Display PlayerPref in InputField 1 Answer
Certain scripts that are attached does not work after build, scene change and closing unity 0 Answers
How to restrict user from typing certain numbers in input field 3 Answers
Need alternative for onEndEdit on InputField 2 Answers
Convert Message to Text Field Input 0 Answers