How to convert a CFrame to an Udim2?

it prints 0.46689748461210384 and what should i multiply with this?

that’s actually what the value should be, I think your UI’s anchor point is set incorrectly, or it’s parent frame is much taller than the minimap

The plricon has an AnchorPoint of 0,0

to perfectly center it set it to (0.5, 0.5), though this shouldn’t fix the issue by itself. Can you post a screenshot of the UI with the plricon’s parent selected to see it’s size?

grafik

grafik

image

More like this, to see the boundaries around the map itself. It should be very snug, fitting a perfect square around the image. My example would result in a bad X coordinate.

grafik
like this?

1 Like

Yes and that looks perfect! very surprising results from plricon at this point. The values you’ve told me should be right in the center of that UI. If anyone knows more about UI that would be lovely help. Otherwise I have to guess the Y value is being given extra values or offsets somehow.

hmm, heres the whole script just so you can look for errors on my side

Yes the issue is your are creating another UDim2.new but the function returns one!
just slot it in like so

local mapPosition = player_to_map(PlayerPos)
PlayerIcon.Position = mapPosition

Also please paste scripts with three backticks like so

```
– paste your script here!
function beep_boop()
end
```

1 Like

yea, i just realized that too, its fixed now

works perfectly now, thx for the help!
grafik
grafik

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.