Tabletop Simulator

Tabletop Simulator

Table Position Finder
3 Comments
Habanero 6 Mar @ 6:09pm 
@BIGFETA Thanks, that's exactly what I checked here for.
BIGFETA 1 Dec, 2024 @ 12:19am 
Hello

the code doesn't allow for the coordinates to clear when you delete the object.

The following code should fix that

function update()
local pos = self.getPosition()
local heightOffset = self.getDescription()
local x = math.floor(pos.x*100+0.5) / 100
local y = (math.floor(pos.y*100+0.5) / 100)
local z = math.floor(pos.z*100+0.5) / 100

if heightOffset ~= "" then
y = y + tonumber(heightOffset)
end

setNotes("{"..x..", "..y..", "..z.."}")
end

function onDestroy()
setNotes("") -- Clear the notes when the object is deleted
end

Kind Regards
pming 1 Nov, 2019 @ 11:25pm 
LOL! Never mind...I made the 'graphical designer mistake' of assuming you were getting the upper left point of the text box with the gizmo. This gizmo is to be placed...
IN THE MIDDLE OF THE TEXT FIELD YOU WANT TO MAKE.
(Just figured I'd all-caps that so others won't make the same mistake I did)