Search Unity

[CLOSED]How to set the input field on start?

Discussion in 'UGUI & TextMesh Pro' started by KiTS0, Oct 5, 2019.

  1. KiTS0

    KiTS0

    Joined:
    May 25, 2017
    Posts:
    2
    EDIT: I've found and fixed the issue.

    This is not setting the InputField on start.

    Code (CSharp):
    1.  
    2. //Class scoped
    3. public InputField mouseXSensitivityInput;
    4.  
    5. void Start()
    6. {
    7.    mouseXSensitivityInput =     GameObject.Find("MouseXSpeedInput").GetComponent<InputField>();
    8. }
    9.  
    MouseXSpeedInput is the name of the GameObject
    that has the InputField script that I want to edit. I can drag
    and drop this GameObject in to the 'None (InputField)' in the
    editor just fine.

    Any ideas?
     
    Last edited: Oct 5, 2019