GUI not positioning correctly

Can you show me how much to the right? Like send me a screenshot.

image

image

1 Like

No, this is wrong. Instead parent the MouseHoverGui to the playerGui, and parent the script to the former.

It’s not good practice.

gui.MainFrame.Position = UDim2.new(0,X,0,Y+gui.MainFrame.AbsoluteSize.Y/2)

You shouldn’t have to do this complex sum math if you have it set up correctly, @HystericalBinky make sure that when you set the size of your mainframe, it’s what you were looking for, you may be setting it too large.

Its back to being correctly positioned for the X axis but the Y axis is still to high.

image

You may have this problem, where you’re positioning it, but the outer frame is too big. I see you are resetting the size in the script.

The size of the mainframe is barely large enough to fit the contents, so it should be fine. The UDim2 that changes the size of the healthbar is just so that it displays properly how much health the enemy/whatever your hovering over has left. I am trying to fix where it positions, the healthbarsize changing should not affect it as it is a child of the MainFrame.

Could you just make sure, by going in game and finding it’s size?

Assuming this is correct, and your set up is seamless, your original code should work properly, if you did everything I said.

gui.MainFrame.Position = UDim2.new(0,X,0,Y)

This works.

image

I see that the text above is not in the mainframe properly, however I don’t mind that as long as the health bar is properly alligned with the mouse.

How high…?

Your anchor point is fine, I’m not seeing anything wrong with the starting code. Can you revert to the starting script? Also make sure you parented the screengui to playergui not to the script.

Idealy I wanted it kind of next to the arrow, but it didn’t even position properly without changing its position so I couldn’t move it via trail and error myself.

Can you visually tell me what you mean by that?

I did put the screengui under playergui now, I reverted it back to the old script but its still higher then it should be.

Now, check the size. Make sure it’s fitted, do everything I told you before.

I did, it still happens for some reason.

Disable GuiInset, I just realized, lol. There’s your solution.