I would like to take in value for the editor, I have created a InputField which takes in only number.
now i want to bring the values in to script as integer and manipulate it.
Is this an editor script or an inputfield from a scene/game?
What does your script look like so far?
im working with c#, how do I assign the value from the inputfield to an int variable in c#?
My script looks bad!
Use UnityEngine.UI
Create field “public InputField someText” before public void Start() and drag your InputField there(in the inspector).Now you can access that control in your script.
if you use the previous poster’s example, you can get the input from “someText.text”
can we assign inputfield data to a string variable ?
i cant assign the input in the variable
Rather than necro-posting to five-year-old threads, start your own post… it’s FREE!
Remember that NOBODY can read your mind. YOU need to communicate clearly.
How to report your problem productively in the Unity3D forums:
This is the bare minimum of information to report:
- what you want
- what you tried
- what you expected to happen
- links to documentation you used to cross-check your work (CRITICAL!!!)
- what actually happened, especially any errors you see
If you post a code snippet, ALWAYS USE CODE TAGS:
How to use code tags: https://discussions.unity.com/t/481379