Forum rules - please read before posting.

Player vicinity - Cannot make it work

Ok, after a whole day of attempts, i give up. I set up game for player vicinity, hotspot detector was automatically created on player prefab (but NOT child of sprite, moved myself), i followed instructions but nothing happens when player comes near hotspot.
i'm using 2d for my game. What am i missing?


  • edited February 2023

    Are you maybe missing the Collider on the Trigger and is the positioning correct?

    For a Player prefab to be able to detect Hotspots, they must be equipped with a Hotspot Detector. To make one, add an empty GameObject to your Player prefab as a child object (and also a child of the sprite if in 2D). Leave it untagged and move it to the Ignore Raycast layer.

    Then add a collider (in 3D games, this will usually be a Sphere Collider; in 2D games, this will be a Circle Collider 2D), with Is Trigger? checked. Then add a Detect Hotspot component, and position it such that its centre is slightly in front of the player, with the radius extending a few feet outward.

    NOTE: If your Player does not have a Rigidbody **or **Rigidbody 2D component on their base, you will need to add one to the Hotspot Detector.

    Finally go back to your Player's Inspector and assign this new GameObject as the
    Hotspot detector child.

    And update to the newest version, there was a bug with the Ignore Raycast layer.

  • As there are a lot of settings involved when it comes to this topic, it's best to see the specific values you're using.

    Can you share your AC/Unity verisons, as well as screenshots of your Settings Manager, a typical Hotspot, your Player, and that of the Hotspot Detector (full GameObject Inspectors)? I'll see if I can spot the issue.

  • edited February 2023

    Hi, here are some images. Let me know if more are needed. My goal is, when player comes near, starts a conversation

  • Hotspots are a way of allowing the player to run interactions upon input. A Hotspot Detector is a way of gathering up nearby Hotspots - but it still requires that the player uses input to interact with them.

    If you're looking to have the NPC being talking as you approach them, attach a Trigger to the NPC instead.

    Triggers are a way of running Actions when the Player enters a given boundary. See the Manual's "Triggers" chapter for details, as well as this tutorial (in 3D, but the concept applies for 2D as well).

    If I'm misunderstanding, and you want the player to use input as normal to interact with the NPC, I'll need the full images mentioned above - including the full Inspectors of your Player, Hotspot, and Settings Manager.

  • Thanks for your support! Sorry for delay in repplying, i was away

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.