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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question How can I shadow my old textmeshes ?

Discussion in 'Editor & General Support' started by San_Holo, May 31, 2022.

  1. San_Holo

    San_Holo

    Joined:
    Sep 26, 2014
    Posts:
    152
    Hi, I've been looking around for a way to add a simple shadow to my old project using textmesh objects, I'm not going to update Unity and If I can't find a shader on-line ( I have tried come up dry ) so could I manually add a shadow to the font I'm using ? the font-material is an instance using 'GUI/Text Shader' - I suppose I could buy an asset, I'll check, but any help would be appreciated, thanks
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,797
    Your best bet might be to clone each one, color it black, move it back in 3D space a hair, then move it right and down.

    EDIT: removed my misguided ramblings about the viewport coordinate space. I had my TextMesh confused with my GUIText legacy... too much API!
     
    San_Holo likes this.
  3. San_Holo

    San_Holo

    Joined:
    Sep 26, 2014
    Posts:
    152
    OK Kurt thanks for the reply, I did actually try that on a couple of textmesh's and yes it was fine, I have some scripts which update certain textmesh's on the fly, I suppose I'll just make a clone of it and adjust my scripts accordingly to update my 'shadow' textmesh also at the same time, oh well, here we go... I have quite a few :) anyhew thanks
     
    Kurt-Dekker likes this.
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,797
    I would automate it: insert a single script in the scene that finds them all ONCE, then clones them.

    Or if they are dynamic, clone them at creation time.

    In the 9 minutes since I posted above, I added a dropshadow to my own ancient Kurt Arcade digits, doing exactly the above. Thanks for the idea, the text reads way better now... see enclosed. Run that scene and start clicking.
     

    Attached Files:

    San_Holo likes this.