Better way of making a form

I have a class called Coordinate that is comprised of a Vector3 and a few strings. I want the user to be able to create an instance of this class through a form.

Currently, I bring up a UI interface in which the user can enter in the necessary variables. On end edit of each input field, I assign that value to an instance of that class called “temp”. Then when the user submits the form via button press, the values of temp are then used to create a new instance of the class.

This just seems wrong. Surely I should be able to access the values of the input fields to create the class when Submit is clicked and avoid the usage of “temp” altogether.

It currently works fine… it just… seems so wrong.

I am honestly struggling to form a precise mental image of the setup you describe.

Could you perhaps elaborate a bit more?

All you need is to access the Text property of the input box.
https://docs.unity3d.com/Manual/script-InputField.html

That makes too much sense