GetCore ChatWindowSize/ChatWindowPosition replacements?

Remembered these from a few years ago and wanted to get the size to adjust my guis position dynamically to be just below it.

They don’t appear to work anymore though. Does anyone know if there is a replacement?

The code I’m using to get them is:


local function sizeChange()
	local chatSize: UDim2 = game.StarterGui:GetCore("ChatWindowSize")
	local chatPos: UDim2 = game.StarterGui:GetCore("ChatWindowPosition")
	if not chatSize or not chatPos then
		warn(chatSize, chatPos)
		return task.delay(1, sizeChange)
	end
end
sizeChange()

This then warns:

nil nil (x112)

In a never-ending repeat. Meanwhile, I am actively in the actual chat typing messages, and it continues to say nil nil.

3 Likes

I also am curious. I need to adjust the player’s UI depending on what they are currently doing, and knowing where chat is open one of the criteria.

I had the same problem, and this fixed it:

local TextChatService = game:GetService("TextChatService")

local chatWindowConfiguration = TextChatService.ChatWindowConfiguration
local chatWindowSize = chatWindowConfiguration.AbsoluteSize
local chatWindowPosition = chatWindowConfiguration.AbsolutePosition

Now, printing chatWindowSize and chatWindowPosition both output UDim2 values instead of nil.