I know there’s just something simple I’m missing here, and probably tons of answers but can’t figure out what to search for.
I have a bunch of points that are placed on a scene when a user clicks in that area. Those points are taken from prefabs that have a class with a number of variables attached to them.
I also have a number of inputfields.
What I would essentially like to do is make it so that when you click on one of the points, it populates the inputfields from the variables stored in each of the points. Then when you click on a different point, it links the inputfields to the variables in that point.
So when you click on it, it changes the inputfield whatever value is stored in the points variable, and then when you click on another object, that inputfield data stays with the first object and the new objects variables are populated into the inputfields.
I’ve already worked out all the logic to pass the point as a gameobject to the subroutine, just can’t figure out how to make that connection.
I tried the following:
pointName.GetComponent<TMPro.TMP_InputField>().text = point.GetComponent<ScanPoint>().PointName;
pointName is the forms inputfield and point is the selected point. This just erased whatever was put in the inputfield whenever I click on a different point. I know this is some super simple c# logic I’m missing, but can’t find an answer anywhere.