Forum rules - please read before posting.

Detect hotspot on player vicinity

edited September 2014 in Technical Q&A
My goal is to help player detect hotspot and highlight them when player is near them.

I'd like to use the Hotspot vicinity to do that, but seems I'm not able to add the HotspotDetector (child of player) to the Player Settings.

I followed this tutorial, without adding the cycle input, because I just want to highlight the hotspots (player will be able to interact with them with mouse), but seems I can't place the HotspotDetector in the Player Inspector. Seems that Player Inspector doesn't recognize the HotspotDetector game object.

I'm trying to implement this in a 2d scene, I tried both using a circle and a sphere collider.

Is the detection method on vicinity implemented for 2d? Can I use it just to highlight the hotspots?

Comments

  • It's implemented for 2D, yes - you'll want to use the Circle Collider if you're using Unity2D mode, and a Sphere Collider for any other mode (other 2D "moving and turning" options included).

    Do you mean that you don't have the option to define the "Hotspot Detector child" in the Player Inspector, or that it won't accept the object when you drag it over?

    A few things to consider:
    • The option only becomes visible if the Hotspot detection method (in the Settings Manager) is set to Player Vicinity.
    • You need to have a DetectHotspots script attached to the child - this is what the Player Inspector is looking for.
    • You may find that you need to drag a local copy of the Player prefab into the scene, assign the child, then apply it to the source prefab, for it to take effect
  • - I'm using Unity2D mode.
    Hotspot detection method is set as Player Vicinity
    - I added the sphere collider, attaching to it the DetectHotspots, setting it as a child of player prefab
    - I placed the HotspotDetector on the Player PRefab in the Hotspot Detector Child
    - (I changed the Layer of the HotspotDetector to IgnoreRaycast)

    Alas it seems not to be working. It doesn't show the hotsposts when I go near them.
    I tried it and it seems to lock the far hotsposts, without highlighting near ones.

    I do the following:
    - Move player very close to an hotspot
    - I move the mouse over a close hotspost -> it works
    - I move the mouse over a far hotspost -> it doesn't work

    Maybe that was the idea behind the vicinity hotspot. Not sure.

    I'd like to use it simply to show on the screen all the nearby hotspots.
  • You need a Circle Collider for Unity 2D mode, not a Sphere Collider.

    The intended effect is for Hotspots within the collider to highlight and be interactive - those outside will not.  As well as the highlight effect, you can also set Display Hotspot icon within the Settings Manager to Only When Highlighting - this will then show either an icon or texture over any "available" Hotspots.
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.