Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Bug Input TextField text selection (TextMeshPro 3.0.6, Unity 2021.3.21f1)

Discussion in 'UGUI & TextMesh Pro' started by koZis, Apr 27, 2023.

  1. koZis

    koZis

    Joined:
    Jun 1, 2017
    Posts:
    5
    When I try to select text via mouse cursor in input textfield, application crashes with error:

    UnassignedReferenceException: The variable m_TextViewport of TMP_InputField has not been assigned.
    You probably need to assign the m_TextViewport variable of the TMP_InputField script in the inspector.
    UnityEngine.Transform.get_rotation () (at <ba783288ca164d3099898a8819fcec1c>:0)
    UnityEngine.RectTransformUtility.ScreenPointToWorldPointInRectangle (UnityEngine.RectTransform rect, UnityEngine.Vector2 screenPoint, UnityEngine.Camera cam, UnityEngine.Vector3& worldPoint) (at <d81e1bf4263c45bfaefffe2fa3fa3ddc>:0)
    UnityEngine.RectTransformUtility.ScreenPointToLocalPointInRectangle (UnityEngine.RectTransform rect, UnityEngine.Vector2 screenPoint, UnityEngine.Camera cam, UnityEngine.Vector2& localPoint) (at <d81e1bf4263c45bfaefffe2fa3fa3ddc>:0)
    TMPro.TMP_InputField+<MouseDragOutsideRect>d__295.MoveNext () (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_InputField.cs:1719)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <ba783288ca164d3099898a8819fcec1c>:0)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    TMPro.TMP_InputField:OnDrag(PointerEventData) (at Library/PackageCache/com.unity.textmeshpro@3.0.6/Scripts/Runtime/TMP_InputField.cs:1704)
    UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:514)