Forum rules - please read before posting.

Hotspot detector questions

I'm trying to use the hotspot detector in my first-person game but it's not quite doing what I want. I'd like hotspot icons to display for all hotspots that are within the detection radius but right now the only way I can make them appear is by setting Display Hotspot Icons to Always. Otherwise, I don't see them at all. But with this setup, I can see icons for faraway hotspots that are not within the detection radius, which is not ideal. The other problem is I am having really inconsistent results with the icons appearing through walls. I have checked "Hide icons behind colliders" but I'm still seeing the icons through many of my walls. All of my level geometry has mesh colliders.

I tried using Draw icons in World Space and this causes the icons to be correctly obscured by obstacles but the icons are drawn at the center of the objects and thus clip through them in an unappealing way. The Screen Space version appears to be preferable if I can get them to appear and disappear consistently.

Any guidance is appreciated!

Comments

  • I figured out that my second issue was caused by my hotspot ray length being too small. After I increased the ray length that caused the icons to be correctly hidden behind colliders.

    I assume then that the distance that I can interact with hotspots is governed by the hotspot detector radius? What if I want two different radius? One to make the hotspot icons appear, and a slightly smaller one that enables the player to highlight and interact.

    I'm just thinking that I want the icons to draw the player to closeby points of interest, say in a 2-3 meter radius but to actually use the hotspots I'd like the player to be a bit closer, say within one meter or so.

  • When using Player Vicinity detection, Hotspots will need to be within the boundary of the detector, yes.

    Increase the radius of your detector so that it extends to e.g. 3 units in front of the camera, but reduce the Hotspot ray length field to 1. To have icons show up when within the boundary, set the Hotspots in vicinity field to Show All.

    By default, a Hotspot's icon will be rendered at the centre of their collider. You can override this position, however, by assigning a Centre point (override) Transform in the Hotspot's Inspector.

  • Hi Chris. Thanks for your reply. I gave that a shot however I'm finding that in order to make the detection radius work as expected I have to set the hotspot ray length to a large number. If I use a small ray length the icons appear even when I am outside the detection radius.

    I'm also finding that while world space icons are obscured by colliders regardless of the ray length, the screen space icons seem to require a large ray length for them to be obscured by colliders.

    Even with the offset, I don't like the way the world space icons look. They present a problem with my doors and I don't like the scaling.

    The configuration that I have found that is the closest to what I want is using screen space icons combined with a large ray length. That gives me the functionality I want. The icons only appear when I approach and are obscured by obstacles. But this leaves me with the detection radius as affecting both the range that icons are visible and the range that the player can interact with hotspots. Ideally they would be different. I'm not sure what to do about it but maybe try to customize the script. Have you got any tips of what I should be looking for?

  • Would it be feasible to have a different raycast for checking if a hotspot is within the interactable distance? As distinct from the hotspot raycast which seems to be also used to determine the visibility of icons.

  • To be honest, I'm not sure if this is really necessary for my game. I'd still be interested in any input but it's not the highest priority.

  • Certainly it's possible to bypass AC's icon drawing in favour of a custom one - this technique is demonstrated in the "UI template: Screen-space Hotspot detection" package over on the Downloads page.

    With the built-in settings, there's a lot of fields at play and also your specific layout/scene factors in. If you'd like to PM me a project that demonstrates the issue, I'll take a look.

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.