Forum rules - please read before posting.

Highlight Menu

Hello,
I'm trying to show some hints on the screen to act as a tutorial.
I created a Menu with a Unity UI Prefab with just a Panel and a Image with an arrow.
I'd like to highlight the image.
I tried adding the highlight script to the image in the prefab, unchecking the Brighten materials and calling Object:Highlight from an ActionList that starts when the Menu is shown. I Set the Image as the Object to highlight, the ConstantID is stored. But it doesn't work. Also tried attaching Highlight script to the Canvas parent, still not working.
I tried adding a script that calls GetComponent<Highlight>().GetHighlightIntensity()
but it's always returning 0.
I opened the Highlight script and I see that it is not intended to work with Unity UI Image.
How do I achieve such an effect? Could it be an animation?
What do you suggest to create an effective hint system, with Menu Popups or Text Labels that come out after some time or after some Actions?
I need the player to learn how to play.
Thank you

Comments

  • edited May 2015
    Object: Highlight, that brightens material only works on 3d objects like planes, quads, and other meshes , I don't think it works just on sprites.

      Create a quad, set it's size the same of your sprite, attach highlight script to it, in your actionlist run Object: Highlight.

    Regarding the hint system. I'm working on it myself and nearly done with it.

    What you need to do is to make a Hint button menu, link it to your actionlist that goes through the objects you want to highlight/hint in your scene, you turn off Hint button menu in your actionlist, after it checks what objects are present, then it highlights your first object, player deletes it with onmosuedown, and turn your Hint Button back on after cooldown is completed that you add at the bottom of your actionlist .

    If you want your Hint Button cooldown to be carried over across your levels you will need to use DontDestroyOnLoad attached to your actionlist that you fire with your Hint Button menu.

    Hope this helps.
  • The Highlight script is intended for 3D objects, it's true, but the code only references the Renderer component - which SpriteRenderer derives from.  I don't believe it'll work with Canvas Renderers, however.

    Getting the Highlight script to work with sprites, however, seems a bit of a dark art - it essentially affects the "_color" property of any material it finds - something Unity's default sprite material doesn't have.  I recall that others had luck finding a sprite material that was compatible, but I can't offer more than that, I'm afraid.

    However, I would say that animating your UI would be the better option anyway.  If you add an Animator component to your Canvas and create the animations / Mecanim controller as you would any other Unity object, then you'll be able to control it with the Object: Animate Action.
  • Using an Animator with just an animation clip looping on Image.Color.a worked perfectly. Thank you!
  • Thank you SkyTree for your answer, I don't know if I need an Hint system like the one you're describing, but the details are very useful. 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.