Forum rules - please read before posting.

Display Hotspot icons via Script Only doesn't work?

edited October 2018 in Technical Q&A
Hello!
After 1.65.1 update the "Show Hotspot icons: Via Script Only" stopped working (or I did something wrong).
I modified "Interacitve Boundary.cs" by adding three lines:

public Hotspot hotspotToShow; - here I set the hotspot reference,

private void OnTriggerEnter/Exit (Collider other)
{
            if (KickStarter.player != null && other.gameObject == KickStarter.player.gameObject)
            {
                hotspotToShow.SetIconVisibility(true/false, 5f);
                playerIsPresent = true;
            }
}

So, when my MainCharacter enters the Trigger, the Hotspot icon should show up. And before update that works fine. Now it's not (of course I changed "Interactive Boundary.cs"). I want to show all nearby hotspot, when player is in their neighborhood. All other options ("Show always", "Only when highlighting" etc.) works well.

One more thing, I have a warning message if "Via Script Only" is enabled. I don't have associated Highlight object because I don't use higlighting.

Screens:
https://pasteboard.co/HIHEekU.png

Comments

  • edited October 2018
    What previous version were you updating from, and what version of Unity are you using?

    As the method involves custom scripting, how/when are you invoking SetIconVisibility without hacking InteractiveBoundary?
  • edited October 2018
    previous was 1.65 (updated to 1.65.1). Unity is 2018.2.1f.1.

    Without hacking IB.cs I tried something like this (added to this same object where InteracitveBoundary is):
    https://paste.ofcode.org/5N8PyyWUh8Ln9HUsaGuCnh
    (hotspotToShow attached manually)

    I inovke SetIconVisibility when my player enters the trigger.
    Of course settings are set to "Via script only".

  • The issue is that the Highlight component is currently required - it should work if you attach/assign it (and uncheck Auto-brighten materials? to prevent it affecting any mesh).

    v1.65.2 will remedy this.
  • So question. I wanted something like this but I'm having issues getting it working even though it worked in the past.

    I'm using AC 1.73.8

    While the icon shows, it only shows when the hotspot detector is over the hotspot. Not the interactive boundary.

  • Interactive Boundaries are a way of further limiting when a Hotspot is interactive - rather than a replacement. You're still bound by the "Hotspot detection method" field in the Settings Manager.

    If you want to make Hotspots interactive at all times the Player is inside a Boundary, you'll need to either increase the size of their Hotspot Detector to be large enough to always "reach" a Hotspot from the edge of the Boundary, or use a custom Hotspot detection method.

    The "UI template: Screen-space Hotspot detection" package on the Downloads page provides an example of how the presence of an Interactive Boundary can be used - through script - to bypass regular distance checks when searching for nearby Hotspots.

  • I'm not actually to make the hotspot interactive at all times. I just want to be able to see the hotspot icon that you can set in the settings over the hotspot when the player enters the interactive boundary trigger.

    That was what the original OP was asking about.

  • OP was relying on custom code - I'm presuming you are as well?

    I'd need to know what that code is, as well as see screenshots of the Hotspot/Highlight components and your Settings Manager.

    If it was working before, what change was made that prevented it from working now?

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.