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 Changing TextMeshProUGUI.raycastTarget at runtime on code has no effect on object

Discussion in 'UGUI & TextMesh Pro' started by FernandoHC, Jul 10, 2018.

  1. FernandoHC

    FernandoHC

    Joined:
    Feb 6, 2018
    Posts:
    338
    Hello,

    I have a requirement on my game to change the raycast-ability of a TextMeshProUGUI at runtime, both false and true, however setting it to either has no effect on it. Although the boolean tick changes on the inspector for the object, there is no actual effect in the game, it remains with the behavior it had previously.

    The code is simple:
    Code (CSharp):
    1. textMesh.raycastTarget = true;
    Changing it directly via inspector, by ticking it, at runtime works as expected.

    Is there any after-call I have to make after changing the raycast for it?

    Cheers
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Let me take a look. I'll provide feedback once I have more information.