.Position() not working

Hello developers, for some reason when I used this code, Text.Position = UDim2.new(0.5, 0, 0.04, 0), the position just does not change… I don’t know why…?

I thought that it was weird and so I checked this, and I used the correct code. Can anyone tell me what I’m doing wrong?

Could we see what Text is? (Is it the Text itself or a TextLabel)

Maybe you have to use CFrame ?

OP is talking about the position of a gui object, not a basepart

3 Likes

It’s a TextLabel. (character limit)

Show how you define the variable Text

1 Like

Better yet show the whole script… nothing is wrong with the snippet you showed us, but it doesnt show a change in position, only the position. We need to see more.

1 Like
local Text = script.Parent
Text.Position = UDim2.new(0.5, 0, 0.04, 0)

Try this out:

local Text = script.Parent
warn("OLD POS: " .. Text.Position)
Text.Position = UDim2.new(0.5, 0, 0.04, 0)
warn("NEW POS: " .. Text.Position)
1 Like

Sorry for the late response, plus bumping this back up but I’m still having issues with this & this didn’t do anything.

What does the script provided by DownRest says

It says,
image (line 47)
image

try

local Text = script.Parent
warn(string.format("OLD POS: %s", Text.Position))
Text.Position = UDim2.new(0.5, 0, 0.04, 0)
warn(string.format("NEW POS: %s", Text.Position))
1 Like

image, line 47.

warn(string.format("OLD POS: %s", MainFrame.Position))

Not sure if it matters but I am using a Frame and not a TextLabel anymore.

It shouldn’t matter if its a frame nor a textlabel

local Text = script.Parent
warn("OLD POS: ".. tostring(Text.Position))
Text.Position = UDim2.new(0.5, 0, 0.04, 0)
warn("NEW POS: ".. tostring(Text.Position))
1 Like

Alright, it printed the following,
image

But the frame’s position didn’t actually change. (Using a localscript.)

If any other developer has any ideas why it’s printing the new position but not actually showing let me know. :slight_smile:

Can we see the picture of explorer where this Frame located?

Is the UI visible on your screen and can you show the hierarchy of your StarterGui?

Maybe the UI is moved before you even see it?
Did you check the properties to verify the position didn’t change?