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

How can I tween an ImageLabel to another imageLabel?

I am a trying to get one imageLabel to go over another one

local test = script.Parent.Parent.Main.Arrows.LeftA
local testloc = script.Parent.Parent.Main.Receptors.Left.Position

test:TweenPosition(UDim2.new(testloc))

here was my attempt at doing it, but It didn't work.

2 answers

✓ Accepted answer

Do not put a extra "UDim2.new()", since "testloc" is already a UDim.

Here's the code to fix it:

local test = script.Parent.Parent.Main.Arrows.LeftA
local testloc = script.Parent.Parent.Main.Receptors.Left.Position

test:TweenPosition(testloc)

Also, as the other answer says you need to put the other requirements, they're actually optional. That is to make them look even neater.

If this works, please click the "Answer" button just to make sure it helps you.

If you are still getting errors, tell me.

EDIT: Since it's using different frames, here's a fix. Using AbsolutePosition, it should find where it is

local test = script.Parent.Parent.Main.Arrows.LeftA
local testloc = script.Parent.Parent.Main.Receptors.Left --remove the position on this

test:TweenPosition(UDim2.new(0,test.AbsolutePosition.X-testloc.AbsolutePosition.X,0,test.AbsolutePosition.Y-testloc.AbsolutePosition.Y)) --Adding absolutepositions

NOTICE: I didn't test this, it should work tho.

7 comments

0

I am not getting any errors, but it still is not moving

0

It might be because the Receptors is at the same position of the "test" or it's because it already moved, but Roblox was still loading while it was moving.

0

You may of just helped, My receptors and arrows are in two separate frames.

1

Oh, I'm going to edit my post to fix it. I know a way to fix it now!

0

Ok I just edited it.

0

Yup, it worked! Thank you!

1

No problem!

On the last line you are making a new UDim2 when it’s already a UDim2.

test:TweenPosition(testloc)

6 comments

0

That didn't work

0

It should if you replace your line 4 with what I did.

0

That's what I did, but is hasn't moved

0

I have no idea then. Looking at it, it should work unless your setup has more to it.

0

Yeah, the receptors and arrows are in two seperate frames, but RawBlocky says they have it covered now

0

That makes more sense for why it didn’t work.

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