Android mobile chat breaks when resizing is enabled

Seems like this code fixed the problem! I’ll find a way to fix this

This isn’t the best solution, since you are modifying the chatscripts and you might not get any updates to the chat.

It would be better if Roblox pushed the solution themselves rather than having to do workarounds.

3 Likes

I know it would be better if Roblox did the job for us and I know that it might not bring me any new updates since I modified the chatscripts but since Roblox is taking forever to fix this problem, I decided to do it myself

Also, How can we enable Chat Resize without modifying the chatscripts? As you said, Modiying the chatscripts = might not get any updates to the chat

I’m not mad but I’m just trying to help you guys so that’s why I decided to give you guys my alternative way to fix this mobile bug, Thanks for the feedback tho.

Sigh, I guess you’re right… I’m very sorry, This Mobile Bug is still there for 2 Years or More so that’s why I decided to try to find ways to fix this problem by myself, there are some games that already fixed this problem but they didn’t give us the solution to fix this so, I did

1 Like

I have finally found the reason why the bug is being caused by this and it is because of Display Size on Android Phones, here’s a screenshot to explain everything. (and hopefully, the texts and the pictures aren’t too small, Sorry if they turn out to be too small)


For those who are interested, here are my current phone specs

Workarounds
@XxLegitOPxX's Workaround (Highly Recommended)
@Im_Andr3i's Workaround (No longer recommended anymore)

Just add task.wait() or wait() on top of your ChatSettings Script for a couple of seconds and that’s it

task.wait(5) -- or wait(), it's up to you on how long it will wait

-- Then put the rest of the chat settings script and that's it.

Keep in mind that sometimes this workaround does not work (depending on your device) so I recommend you using @XxLegitOPxX’s Workaround instead.

Or try using
@CodeProto’s workaround

To anyone who was wondering what happened to my other post, it was deleted by auto-mod because I mentioned everyone on that post (which means I broke a rule). I really apologize to those who were angry or annoyed about it. (Also that post has the same workaround in the Workarounds section so yeah)

1 Like

In this case it doesn’t matter. Like, at all.

Also I have a feeling that the timing of scripts is different when you use any scale other than normal (perhaps the engine has more things to process?), so that’s why it doesn’t break.


By the way, not sure if it’s related to this issue, but default chat size on my device (Pixel 4a) is way too big compared to OP’s iPhone, and I can see that @Im_Andr3i is experiencing it as well.

And yes, it is an issue, especially when using Dynamic Thumbstick.

1 Like

I think I may have found another workaround solution, but it doesn’t involve yielding like @Im_Andr3i 's solution does. Even with task.wait(5) at the start of ChatSettings was only preventing the bug from happening like half the time in one of my games.

Basically, this script resizes the mobile chat on the Y axis if it ever goes out of screen bounds. Make sure to put this into StarterPlayerScripts:

-- Services
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Chat = game:GetService("Chat")
-- GUI stuff
local player = game.Players.LocalPlayer
local chatGui = player:WaitForChild("PlayerGui"):WaitForChild("Chat")
local chatFrame = chatGui:WaitForChild("Frame")
local chatSettings = require(Chat:WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"))

RunService:BindToRenderStep("KeepChatWithinScreenBounds",Enum.RenderPriority.Last.Value,function()
	if UIS.TouchEnabled and not UIS.KeyboardEnabled then -- Mobile/Tablet
		-- Check if chat size on Y axis is GREATER than screen size on Y axis
		
		if chatFrame.Size.Y.Offset > chatGui.AbsoluteSize.Y then -- Mobile chat uses offset for some reason, rather than Scale like PC does
			chatFrame.Size = chatSettings.DefaultWindowSizePhone -- For me this is set to UDim2.new(0.5, 0, 0.5, extraOffset)
		end
	end
end)
1 Like

This issue has a 20% probability of happening in the Studio Local Server Test Client, regardless of if the chat window is resizable.

I’m happy that there are more people who has finally decided to join and help us all try to solve an annoying bug everyone’s tired of (including me). Also what I was trying to say in my workaround was this

task.wait(5) -- or wait(), it's up to you on how long it will wait

-- Then put the rest of the chat settings script and that's it.

Sorry again if you don’t get it, also I made changes to the post I replied to.

Anyway, there’s no “perfect solution”, only workarounds, the best and perfect solution is to make Roblox fix this, but again to be honest they are taking forever to fix it, and that’s why I decided to create a workaround for this (and to hope that Roblox becomes aware of this actually). If you want to, check out the post I replied to see the workarounds people and I have created.