I am trying to create a pet menu where when the player clicks on the pet it causes a pet info frame to appear which displays key information about the pet.
In order to position the pet info frame to where the pet clicked on is, I am getting the absolute position of the pet GUI and then setting the position of the pet info frame to that absolute position, however when I do this it is not accurate:
This is the code I am using to perform this task:
local function onTemplatePress(temp)
--petInfo is the information frame that pops up
--temp is the pet image clicked on
petInfo.Position = UDim2.fromOffset(temp.AbsolutePosition.X,temp.AbsolutePosition.X-inset.Y)
petInfo.Visible = true
end
If this helps, this is the organisation of my GUI elements:
Template = the pet images that show up in the scrolling frame
petInfo = the frame that pops up when you click on a pet
If anyone knows why this is occurring or a better way of approaching this it would be a great help!