Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] How do I change the position of one UI element to the position of another element?

I already tried doing this and it did not work.

I used a LocalScript Here is my script:

wait()
while true do
	wait()
	script.Parent.Position = UDim2.new(script.Parent.Parent.TextButton.Position)
end

Any help would be appreciated, thanks.

2 comments

0

Any errors?

0

Nope

1 answer

✓ Accepted answer

You don't need to create a new UDim2 instance because TextButton's position property is a UDim2 value. https://developer.roblox.com/en-us/api-reference/class/TextButton If you go to that link and scroll to position, you can see it says "UDim2."

So, the script would look like this:

wait()
while true do
    wait()
    script.Parent.Position = script.Parent.Parent.TextButton.Position
end

4 comments

0

How do I accept your answer?

0

There should be a button at my answer that says "Accept answer". An upvote would be appreciated, too .Thanks!

0

I don't see the accept answer button and I need 25 reputation to upvote.

0

Oh yeah, forgot about the upvote requirement. The accept answer button should be there (I think it might say "Mark as solution" idk)

This discussion is preserved as it was. New answers, comments, and votes are closed.