Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My LocalScript who move my chat make a mistake with the first person?

Asked by 5 years ago

Hi guys, I want to know about a bug that happened with my script recently. When my script is active, I can't control the camera when i zoom in in first person. But when it's disabled it works. Could anyone help me with this ? I want to move the chat but the technique i used was garbage. Thanks:3

That is my LocalScript:

local Player = game:GetService('Players').LocalPlayer
local PlayerGui = Player:WaitForChild('PlayerGui')

--< Functions
local function MoveChat()
    local ChatGui = PlayerGui:WaitForChild('Chat')
    ChatGui.Frame.Size = UDim2.new(0.95, 0, 0.95, 0)
    ChatGui.Frame.Position = UDim2.new(0.025, 0, 0.025, 0)
    Instance.new('UIAspectRatioConstraint', ChatGui.Frame)

    ChatGui.Frame.ChatBarParentFrame.Size = UDim2.new(0.45, 0, 0.065, 0)
    ChatGui.Frame.ChatBarParentFrame.Position = UDim2.new(0, 0, 0.13, 0)

    ChatGui.Frame.ChatChannelParentFrame.Size = UDim2.new(0.45, 0, 0.3, 0)
    ChatGui.Frame.ChatChannelParentFrame.Position = UDim2.new(0, 0, 0.2, 0)

    ChatGui.Frame.ChannelsBarParentFrame.Size = UDim2.new(0, 0.45, 0.065, 0)
    ChatGui.Frame.ChannelsBarParentFrame.Position = UDim2.new(0, 0, 0.13, 0)
end

-- CoreGui
MoveChat()
0
when changing the size of your gui, use scale and not offset. The gui will be compatible with mobile, xbox, and pc. Are you testing your game using the play option or the start option? Need help converting your gui from offset to scale? Use this helpful plug-in to convert it to scale https://www.roblox.com/library/332927999/GUI-Scale-Offset-Converter  Iliketurtles12323 3 — 5y

Answer this question