Forum rules - please read before posting.

Hotspot highlight flicker after mouse leaves the hotspot

I stumbled upon this short flicker when hovering away from hotspots in Adventure creator (latest version on almost latest version of unity.

Do not worry about the custom icon shenanigans I have going on in there, I tried this with non-altered Adventure Creator built in hotspots and the same issue persists:

When I hover on top of the hotspot and move my mouse away from the spot, the alpha of the hotspot flickers. The same happens when I strip away all my custom stuff (in this capture they are just left enabled).

https://youtu.be/cXnGj1IXMP8

I captured some video of the issue in question.

Any ideas? Could it be something with the highlight component? It only appears when I leave the hotspot, if I zoom by it, the alpha change is nice and smooth.

Comments

  • As the icon's transparency is tied to the cursor, I'm assuming you this is due to the Settings Manager's Highlight Hotspots based on cursor proximity? field, as opposed to a custom script.

    With this setting, the icon ought to only disappear gradually - unless the Hotspot is turned off or you're not in gameplay, neither of which appear to be the case.

    Can you share a screenshot of your Settings Manager, as well as the shape of the Hotspot's collider?

    What'll help here is to do a bit of Console logging. If you open up AC's Highlight script, look for the SetMinHighlight function around line 308. At the top of it, copy/paste the following:

    if (gameObject.name == "MyObject") { if (minHighlight > 0f) Debug.Log ("Set value to " + minHighlight); else Debug.LogWarning ("Zero value"); }
    

    Replacing "MyObject" with the name of the GameObject that this specific Highlight component is attached to.

    That'll cause the Console to report changes to its alpha value at runtime - separating zero and non-zero values as Warning and Info messages.

    See if you can find the message that corresponds to the flicker - it may be e.g. a single Warning message amonst a sea of Infos. Select the message in full and copy/paste it here, and we'll see if it sheds any light.

  • I will provide you this info. I get this flicker regardless of the shape of the hotspot colliders, I usually use the box shape.

  • I am not sure if I was clear that this happens on every hotspot in the game.

  • the debug logging does not report anything out of the ordinary... The log looks correct. the value never flicks at zero in the log, but I can clearly see the flicker in the game view.

  • But when I track the Highlight value, I do see an outlier!

    I added the same debug script of yours to the update function of the highlight script. When moving away from the hotspot the highlight value is set to 1 on one frame only. The MinHighlight value stays clean, but the highlight value does not (and this is without any custom stuff from me on top, so this seems to be a bug in the highlight script in Adventure creator).

    When I comment out this bit of the code, the issue is resolved and the flicker is gone:

    I have a few guesses on how this could be fixed, but I am pretty sure you can figure it out from these results in the next update maybe?

  • (My fix ideas did not work)

  • edited September 2023

    Recreated, thanks for the details.

    Instead of commenting out the line, replace it with:

    highlight = MinHighlight;
    

    Does that fix it?

  • Oh it should. I will try.

  • yes this also fixes it

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.