Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro Textmesh Pro dropdown creates scrollbar in wrong position

Discussion in 'UGUI & TextMesh Pro' started by adammast12, Dec 22, 2017.

  1. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8
    As you can see with the images, when I create a new textmesh pro dropdown and open the dropdown in play mode the scrollbar is in a weird position. No matter what I change in the template within the dropdown game object, the scrollbar still gets created in that same position. Has anyone else had this happen? What can I try to get this fixed? Thanks!

    dropdown 1.png dropdown 2.png
     
    micsun-al and Stream like this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The structure of those dropdowns is crucial so make sure that when you are creating one, that is mirrors the structure of the Dropdown that is created when using the Create Menu option.
     
  3. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8
    I should specify, this happens with both my old dropdown menus that used to work up until today as well as with newly created dropdown menus.
     
  4. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8
    Upon further inspection, the pattern is that it puts the created scrollbar at exactly the midpoint of the dropdown list. It seems to not matter what I change in the with the scollbar transform within the template, it doesn't affect the final scrollbar position. Also, this bug persists even after I uninstalled and reinstalled the latest unity update and textmesh pro update so I have no idea how to fix this.
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of Unity are you using?

    Do you get this behavior when you create the Dropdown via the Create - UI - TextMeshPro - DropDown?
     
  6. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8
    I'm using unity version 2017.3.0f3 personal 64bit. And yes, this same thing happens to any new textmesh pro dropdowns that I create via the Create - UI - TextMeshPro - DropDown menu.
     
  7. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8
    Also, I just tested this in a brand new project with a fresh import of textmesh pro and the same problem occurs.
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What is the name of the TextMesh Pro DLLs found in the "TextMesh Pro/Plugins/Editor DLL/..." folder?
     
  9. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8
    TextMeshPro-2017.3-1.0.56-Editor.dll
    and TextMeshPro-2017.3-1.0.56-Runtime.dll
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Those are the correct DLLs. I just tested on my end using Unity 2017.3.0f3 using the same package and everything is working fine. So we have some mystery on our hands.

    Although you have already done this. Please try creating another new Empty project. Then import the TextMesh Pro package from the link for 2017.3 found in this thread and see if you get the same results.

    If possible, can you create a video showing the steps you are taking to create the Dropdown from the Create - UI - TextMeshPro - Dropdown menu? I realize this might appear silly but like I said we have some mystery on our hands so let's look at everything.
     
  11. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8


    There's a video of me creating the dropdown. As you can see at the end, the scrollbar is being pushed in the negative direction by half of the dropdown width. This is consistent for any dropdown width. Also, this was in a new project after i imported the package from the link you provided.
     
  12. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I am able to reproduce the issue which only appears to happen in 2017.3 and not in previous version of Unity.

    I am now investigating this. I'll provide an update as soon as I have more information.
     
    Rocheofpower likes this.
  13. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Had to a chance to look deeper into this and it is not a TextMesh Pro issue but as usual an issue that TextMesh Pro ends up exposing.

    Although I do not know the exact source of the issue, I did find a work around where simply changing the Template child hierarchy will make the Scrollbar render at the correct place. The current order of the Template is :

    Template
    -- Viewport
    -- Scrollbar

    change to
    Template
    -- Scrollbar
    -- Viewport

    It looks like the issue is related to the RectTransform.SetParent() function where the number of child objects and clearly their position affects things.
     
    BoraxKid, lorenzodom, Kellojo and 5 others like this.
  14. adammast12

    adammast12

    Joined:
    Nov 21, 2016
    Posts:
    8
    Thanks so much for the help! I appreciate the time you spent trying to find a solution. I'm glad there's an easy work around for it. Have a good rest of your day!
     
  15. Stream

    Stream

    Joined:
    Oct 28, 2013
    Posts:
    37
    Same problem
     
  16. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @Stephan-B I created a TextMeshPro dropdown and it seemed to be working fine in the Editor. When I ran a build on my iPhone, I noticed it seemed to be incorrect, displaying the dropdown as though it was already opened and not taking touch input. I was using Unity 2017.1 and the TextMeshPro plugin for the 2017.1 version. Do you know what may be causing this behavior?
     
  17. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Are you able to reproduce this in a new scene with just a dropdown and building / running this on an iPhone?
     
  18. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @Stephan-B Yes, I can reproduce it. I believe it is related to a JIT exception that is thrown in xCode when the app is running on the iPhone. It says:
    I had the player settings using the scripting runtime .Net3.5, Mono backend, and Api compatibility with the full .Net 2.0. I tried switching to the IL2CPP, but then when I built I got an error:
    I think the IL2CPP build error might be related to some of the TextMeshPro dlls, but I could be wrong. Do you have any ideas what could be causing the first error? I'm running Unity 2017.1.2f1.
     
  19. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @Stephan-B The normal dropdown widget made by Unity seems to do this as well. Perhaps it is related to that. I'm guessing the TextMeshPro dropdown is just the normal Unity UI dropdown, but you replaced the Text component? My fix was to basically create my own dropdown prefab from separate Unity components and TextMeshPro components, but using the default ones seem to have these errors.
     
  20. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The TMP dropdown is in fact based on the UI one.
     
  21. theherotanner

    theherotanner

    Joined:
    Dec 27, 2017
    Posts:
    1
    The way I found to fix it is to have the template enabled before you start the game. It will disable itself on run, but it does look bad and is annoying. That is how I found to "fix" it. Hope this helps.
     
  22. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Swapping the Viewport and Scrollbar order as described in this post above works fine.
     
  23. Matt-Cranktrain

    Matt-Cranktrain

    Joined:
    Sep 10, 2013
    Posts:
    129
    I also ran into the same problem with 2017.3 and swapping the Viewport/Scrollbar order sorted the problem. Just a rather strange bug!
     
  24. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    This issue is also related to the RectTransform issue which affects object instantiation which is the case here but also impacts object cloning which is what happens when "Apply" is used on a Prefab.
     
  25. OccularMalice

    OccularMalice

    Joined:
    Sep 8, 2014
    Posts:
    169
    Just encountered this tonight as I was swapping out the regular DropDown for a TMP one. I'm on Unity 2017.3.1f1 with the latest TMP installed. Swapping the Viewport/Scrollbar in the template works.
     
  26. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    As previously stated, this behavior was the result of an issue with the RectTransform which has since been addressed in one of the previous patch for Unity 2017.3.

    If you are still running into this behavior, I recommend you download / install the latest patch for Unity 2017.3 which is 2017.3.1p3.
     
  27. kabumere

    kabumere

    Joined:
    Oct 2, 2016
    Posts:
    31
    Just ran into this today. Stephan, your suggestion above about switching the order of the ScrollView and Viewport worked, but I continued reading and saw you said this was fixed in a version of 2017. I'm running 2017.3.1f1 and my Unity Editor tells me this is the latest for 2017.

    Again, your suggestion above fixed the issue, but if there is indeed a Unity 2017 version after my specified version above, send the link if you can. I can't find it.
     
  28. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
  29. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Issues with the RectTransform which were at the root of these behavior were fixed in the subsequent patches for Unity 2017.3. You will need to update to 2017.3.1p4 or to the latest LTS of Unity 2017.4.2f2.