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.

Question Shader error in 'TextMeshPro/Mobile/Distance Field

Discussion in 'UGUI & TextMesh Pro' started by ivyxnite, Nov 26, 2022.

  1. ivyxnite

    ivyxnite

    Joined:
    Oct 10, 2022
    Posts:
    1
    I'm new to game development/coding and have absolutely no idea what I'm doing. I followed a tutorial on making a platformer game and tried to build and run my game but ran into these errors:

    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <0d6ce211ebbc47e1a35a84c3672ff58f>:0
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <0d6ce211ebbc47e1a35a84c3672ff58f>:0
    4. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
    5.  
    Code (CSharp):
    1. Shader error in 'TextMeshPro/Mobile/Distance Field': Couldn't open include file 'TMPro_Properties.cginc'. at line 93
    Code (CSharp):
    1. Error building Player: Shader error in 'TextMeshPro/Mobile/Distance Field': Couldn't open include file 'TMPro_Properties.cginc'. at line 93


    I've already tried deleting and reimporting TextMeshPro several times but am unsure of what to do next.
    I'm using version 2021.3.9f1
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    The shader error is usually due to some import issue or the shaders being split into different folders.

    First, delete the "TextMesh Pro" folder from inside your project.

    Second, I would suggest updating to the latest release of the TMP package which is version 3.2.0-pre.3.. This package can be added manually in case it is not visible in package manager.

    upload_2022-11-26_0-15-9.png

    Once the new package has been installed, you will need to import the TMP Essential Resources which contain the shaders. The TMP Essential Resources can be import by using the "Window - TextMeshPro - Import TMP Essential Resources" menu.
     
    DigitalProfessor and PutridEx like this.