Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity 4.6: Using Meshes on Canvas

Discussion in 'UGUI & TextMesh Pro' started by Marble, Aug 20, 2014.

  1. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,232
    How does one use meshes with the new GUI? I've downloaded the open beta and thought I could add a Rect Transform to a Mesh Renderer and then put it on the UI layer, but Unity crashes. I've filed the bug report, of course, but perhaps there's a supported method.

    I hope this is possible.
     
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,439
    What exactly are you looking to achieve? If you are talking about meshes in the same sense they are used under the hood by the 2D sprite system, then that is one scenario I can understand. I'm not sure if that feature actually exists or not though.

    But I wouldn't expect meshes that have points in three dimensions to make sense in terms of working with things like rect transform. Thats why I ask what you are trying to achieve exactly. Because I believe a lot of scenarios are covered by one of the following:

    Get used to using image-based 2D assets for things like making interestingly shaped UI elements, e.g. by using masks.

    If you want real 3D objects to appear as part of your UI albeit as a 2D image, build them elsewhere in Unity's 3D space and then use camera and RenderTexture to make them appear as some 2D element of your UI.

    Or if you want the UI itself to be 'real' 3D as well as 2D objects, and the context of your UI allows for it to be constructed as all or part of a unity 3D scene without conflicting with your game content, build the 3D parts in the normal unity way and then put your 2D UI elements in worldspace, position them appropriately relative to the 3D game objects, and setup the appropriate scripting, animation, events etc to get them to work together.
     
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,439
    Custom materials/shaders may also have some potential, depending on what exactly the desired result really is, but I haven't looked into this yet.
     
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,439
  5. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,232
    Thanks for your responses. I was thinking about creating a whole UI with untextured (vertex colored) 3D geometry for a resolution independent vector look. One can already do this with raycasts and another camera, but the anchors, stretching options, events, etc provided by the new UI workflow looked much nicer to work with.
     
    Last edited: Aug 20, 2014
unityunity