Forum rules - please read before posting.

Label above the mouse

Hey guys, 
This might be something that was already discussed, however I couldn't find anything. 

So in my case I have hotspot with a label and whenever I put my mouse on the hotspot my label jumps somewhere far away and I cannot understand why.
In the image below you have an example of what I got.
image
Thank you!

Comments

  • We'll need your Unity/AC version numbers, please.

    Also:
    • Where should the Hotspot label be?  Beside the mouse cursor?
    • Is this a 2D game?
    • How is your Hotspot menu drawn?  Let's see its properties from the Menu Manager.
    • What do you mean exactly by "jumps"?  Does it start off correct and then move?  Please be exact when describing the problem.
  • Hey Chris
    • My version number is : 1.60.4
    • The label should be above the mouse or if not possible at least in the center of the hotspot
    • Yes, it is a 2D game
    • It's not done in the Menu Manager, it's a scene hotspot like you see in the photo below
      image
    • The jumps word is wrong, sorry my english is not that good. It's just that the label appears in some random place, each time the same, but when I have more hatospots, every one of them is placed in a place far from the hotspot/cursor.
    Thank you very much
  • edited October 2018
    The Hotspot is in the scene - but the label itself is drawn via the Hotspot menu in the Menu Manager.  Again, please show the contents of the Hotspot menu's properties.

    Is the label correctly placed when selecting a Hotspot in the middle of the screen?

    You also appear to have no GameCamera in your scene.  This is necessary even if you only view the scene from one position.  Place down a new GameCamera2D and make it the scene's default.  You can copy the MainCamera's current position / FOV settings etc to make it match up with the current camera.
  • Oh sorry. Silly me
    Here is a screenshot of the Hotspot Menu
    image

    As for the label placed in the middle of the screen. I created a test Hotspot and the Label is in the middle of the box collider, however, it seems that my problem is with the Polygon Collider.

    Also I have added the Camera for all my scenes,

    Thank you!
  • A Unity UI-based Menu will rely on the RectTransform boundary you supply to determine whether or not it needs to be adjusted to "fit" within the screen - so if that's too wide it'll be more aggressive in being shunted back in.

    The best way to determine if that's the case is to uncheck "Always fit within screen?" and see the Menu's position then.  If it's correct, you'll have to adjust your RectTransform boundary.  If it's still wrong, it's likely the Hotspot positioning.

    When a Hotspot has a PolygonCollider2D component, it's "centre" is considered to be the position of the Hotspot - not the centre of the shape itself.  You can set this manually by defining a "Centre-point override" in the Hotspot Inspector.
  • Thank you very much Chris. It's working perfectly now!

    Have a nice day!
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.