Hello all! I am having a bit of trouble with my ModelPosition to UI position script. The script below does the following; 1. Take position of Monster Primary Part, 2. Get a Normalized X and Z coordinate, 3. Attempt to change Frame position to teh new X and Z… The problem is that the Udim2.new comes up empty! I ran some print functions and everything comes up fine before I change the Position, it is when i put these values into the Udim2.new that it comes up as 0… Please Help!
local RunService = game:GetService("RunService")
local MarkTable = {}
RunService.Heartbeat:Connect(function()
local Map = workspace["Map Data"]:FindFirstChildOfClass("Folder")
if Map then
local voidpos= workspace["Map Data"]:FindFirstChildOfClass("Folder").Entities.Void.PrimaryPart.Position
local Xratio = voidpos.X * (1/(620.002-14.121))
local Zratio = voidpos.Z * (1/(757.146-76.463))
print("VOIDXPOS: "..Xratio..", VOIDZPOS: "..Zratio)
print(UDim2.new({Xratio,0},{Zratio,0}))
script.Parent.MainFrame["Void Mark"].Position = UDim2.new({Xratio,0},{Zratio,0})
end
end)
OUTPUT: