Forum rules - please read before posting.

Player-vicinity hotspot detection not working in 2D

edited September 2014 in Technical Q&A
Hi Chris, I'm still having problems with the player-vicinity-based hotspot detection not working in 2D. Hotspots are working fine in mouseover mode, then I switch to player vicinity and they both stop displaying and stop working (can no longer interact). My player prefab has a child gameobject with a circle collider 2D trigger component, as well as the detecthotspots scripts, and it's set to untagged and ignore raycast. Doesn't seem to make a difference whether I set it to point-n-click, or direct (w/ either keybord&mouse or keyboard/controller).

Comments

  • Yes, the hotspots are all Hotspot2d
  • Still can't recreate this issue, so hopefully it's just something simple that's been overlooked.  The CircleCollider2D's been set to "Is Trigger?", too?

    I'll need to see screenshots of your scene (with the player / collider), and their full Inspectors.
  • edited September 2014
    Here's a capture of the full setup, including inspectors for player, hotspotdetector and the hotspot2d on the door. Hopefully you see something I don't...

  • Thanks for the comprehensive image.

    You need to assign your HotspotDetecter GameObject to your Player Inspector.  Look for Player settings at the bottom, and drag your HotspotDetector into the Hotspot detector child field.

    To get this working as a prefab, you'll need to drag the Player into the scene while the game isn't running, make the change, update the prefab, and delete from the scene once finished.

  • Excellent - working now. Didn't notice that field in the Player component and that step isn't in the part of the manual that explains how to set it up (pg.44 in case you want to update it). Thanks for the help, Chris!
  • One more thing while on the subject: I noticed that as the player scales with the sorting map, the hotspotdetector collider doesn't scale with it, which leads to a lot of inconsistency with hotspot detection, subject to the player's position on the screen. Is this a bug or something I didn't setup properly? Is there some way of fixing it? Adding the FollowSortingMap component to the hotspotdetector doesn't seem to affect the issue.
  • edited September 2014
    That sounds like a bug (or an oversight)!  I'll investigate..
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.