Search Unity

help with gui texture on tagged targets

Discussion in 'Scripting' started by melonhead, Feb 7, 2016.

  1. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    i am trying to get a gui texture be placed on any enemy tagged objects in the camera field of view, i have looked on youtube and this forum but cant seem to find a simple help tutorial and most seem to be in javascript and not c#, i dont need a full targeting system only a simple way to add the gui texture to any enemy tagged with enemy tag.

    thanks in advance
     
  2. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    anybody?
     
  3. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    if you're new to UI stuff and/or not particularly attached to the old legacy UI system (which uses GUI texture) it might be better to look into the new canvas based UI.

    https://unity3d.com/learn/tutorials/topics/user-interface-ui

    without knowing anything about your project it should "just" be a case of putting a sprite onto a (most likely world space) canvas
     
  4. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    Cheers, bit confusing as i kept watching how to use the guitexture but now the ui has changed it seems harder to get to grips with, i take it the sprite is the ui image as i am using 3d and seems like sprite is for 2d canvas is that right