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

How can I tween an ImageLabel to another imageLabel?

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
2
Answered by
Rawblocky 217 Moderation Voter
5 years ago
Edited 5 years ago

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.

0
I am not getting any errors, but it still is not moving User#210 0 — 5y
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. Rawblocky 217 — 5y
0
You may of just helped, My receptors and arrows are in two separate frames. User#210 0 — 5y
1
Oh, I'm going to edit my post to fix it. I know a way to fix it now! Rawblocky 217 — 5y
View all comments (3 more)
0
Ok I just edited it. Rawblocky 217 — 5y
0
Yup, it worked! Thank you! User#210 0 — 5y
1
No problem! Rawblocky 217 — 5y
Ad
Log in to vote
0
Answered by
Dog2puppy 168
5 years ago

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

test:TweenPosition(testloc)
0
That didn't work User#210 0 — 5y
0
It should if you replace your line 4 with what I did. Dog2puppy 168 — 5y
0
That's what I did, but is hasn't moved User#210 0 — 5y
0
I have no idea then. Looking at it, it should work unless your setup has more to it. Dog2puppy 168 — 5y
View all comments (2 more)
0
Yeah, the receptors and arrows are in two seperate frames, but RawBlocky says they have it covered now User#210 0 — 5y
0
That makes more sense for why it didn’t work. Dog2puppy 168 — 5y

Answer this question