Forum rules - please read before posting.

[BUG] interaction menu has wrong offset on NPC hotspots

edited October 2014 in Technical Q&A
I noticed something peculiar after the 1.39 update. I want the cursor icon interaction menu that appears over my hotspots to display at the center of the hotspot colliders. Whereas in 1.38 the interaction menu would render at the feet of the characters, it now renders way up above them at the edge of the screen. On regular hotspots it works fine and displays perfectly in the center.

Here's what happens. It seems the larger the collider Y offset, the further away from the center the menu renders:

And these are my settings:


  • I believe this is to do with the character's scale.  What are the scales of the base NPC object, and it's sprite child?
  • They are both set to 1, but they adhere to the navmesh which scales them, maybe that's part of the same thing?
  • It is.  1.39a fixes the problem.
  • Sad to say 1.39b does not fix the problem... which file is the fix in? Maybe that's one of the rare few I don't update.
  • Strange - I recreated the problem and it's fixed for me in 1.39a/b.

    The fix spanned several files, but the main one was PlayerMenus.
  • edited October 2014
    Very strange, I updated that file (basically everything except MenuSystem, the tag/settings managers and the demo files) but it still happens.

    It is definitely in the scaling because when I change the collider center offset to get it the way I expect it to work, in the next scene where the character is scaled differently the menu is off from the adjustment I just made again. Aka there is no general workaround.

    Maybe it has something to do with my sprite childs having follow sorting map and all three of its options checked, or maybe because I have disabled player movement that somehow they ignore the navmesh but still do the scaling, I don't know...

    It only displays correctly when I turn the collider's Y-offset to 0 and increase the Y-size to some big number like 24 (double the sprite height)...
  • It may be a combination of scaling with the way your colliders are set up.  I've been testing it with the "Brain2D" player prefab that the 2D demo uses.  Is your NPC set up the same way?  It'll help to see some screens of the scene view + inspector of both your root object and sprite child.
  • I think mine are slightly different but not by a whole heck of a lot. In any case I've made fullscreen screenshots of all the things you mentioned so you can check it out. You can grab that zip here. If there is anything else you need a screenshot of don't hesitate to let me know.
  • edited October 2014
    Thank you, fixed.  It was to do with the screen height being wrongly accounted for.  Unfortunately the fix is a bit complex, so you'll have to wait for the 1.40 update, rather than a script line to change.
  • edited October 2014
    Ahaaa okay interesting. Well, I'm happy the cause has been found anyway so I'm cool with waiting for 1.40 :) Thanks!
  • It did fix it, thanks!
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.