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

[Answered!] TweenSizeAndPosition not used correctly?

Asked by 8 years ago

Hello! I'm new, so I'm going to introduce myself right quick; I'm NathanTheDeveloper, the Head Developer of RP Studios! Now to skip the pleasantries and move on with the subject. C:

I'm trying out TweenSizeAndPosition since I have yet to use it, and this is it's time to shine. I have been relying on the Wiki for help but have yet to find a compromise to my error.

The script:

script.Parent.MouseEnter:connect(function()
    script.Parent:TweenSizeAndPosition(UDim2.new(0.26, 0, 0.14, 0) (0.043, 0, 0.375, 0), 'Out', 'Quad', 0.4)
    script.Parent.Parent.SmallBox2:TweenSizeAndPosition (UDim2.new(0.03, 0,0.14, 0) (0.005, 0,0.375, 0), 'Out', 'Quad', 0.4)
    script.Parent.Parent.SmallBox2.BackgroundColor3 = Color3.new(155/255, 190/255, 255/255)
end)
script.Parent.MouseLeave:connect(function()
script.Parent:TweenSizeAndPosition(UDim2.new(0.25, 0, 0.13, 0) (0.03, 0, 0.38, 0), 'In', 'Quad', 0.4)
script.Parent.Parent.SmallBox2:TweenSizeAndPosition(UDim2.new(0.02, 0,0.13, 0) (0.005, 0,0.38, 0), 'In', 'Quad', 0.4)
script.Parent.Parent.SmallBox2.BackgroundColor3 = Color3.new(8/255, 94/255, 255/255)
end)

The errors:

19:30:11.647 - Players.Player.PlayerGui.MainGui.BackgroundFrame.Continue.LocalScript:2: attempt to call a userdata value

Players.Player.PlayerGui.MainGui.BackgroundFrame.Continue.LocalScript:7: attempt to call a userdata value

If you have yet to catch on to my intentions, I'm trying to make the GUI get larger when the mouse hovers over it and go back to its normal size when the mouse leaves. I've been having some errors with the Tween stuff, I know how to use TweenPosition perfectly, but I'm brand new to both Size and SizeAndPosition. If you have any questions, just ask!

~Thanks ahead of time! c:

2 answers

Log in to vote
1
Answered by
Azmidium 388 Moderation Voter
8 years ago

Inside of the tween it appears you are doing this: TweenSizeAndPosition(UDim2.new(0.02, 0,0.13, 0) (0.005, 0,0.38, 0)...

You are making a simple typo mistake, everything seems right. You need to have 2 separate "sections" in the function for each UDim2. What you're doing is attempting to combine UDim2's but not at the same time (if you catch my drift), they need to be separated.

TweenSizeAndPosition(UDim2.new(0.02, 0,0.13, 0), UDim2.new(0.005, 0,0.38, 0)...

This is just fixing line 2, you have the same issue in line 7.

Hope this helps!

Ad
Log in to vote
0
Answered by
Im_Nick 30
8 years ago

You need to UDim2.new(s) :P

:TweenSizeAndPosition(UDim2.new(0,0,0,0), UDim2.new(0,0,0,0) , "In", "Quad", 0.4)
--                                                 ^                                          ^
0
Great answer! You are extremely helpful from the looks of your profile for the time you've been here. I recommend providing an explanation in each of your answers, it'll help the scripter figure out what his issue is. (See my answer for example) (P.S WELCOME TO SCRIPTING HELPERS! :D) Azmidium 388 — 8y
0
I already had that. xxxXMrsAwesomeXxxx 70 — 8y
0
O. nevermind xxxXMrsAwesomeXxxx 70 — 8y

Answer this question