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

Frame:TweenPosition break or stop? Is that possible?

I started making a pistol, and now I want to make that cross aim thing in the center of the screen. I made a small frame, with four more frames inside of that that looks like this. I made a script that detects clicking, everything's okay with that, but I want to make like when i click it gets bigger for a moment.

rightaim:TweenPosition(UDim2.new(1.089, 0, 0.5, 0),"Out", "Quad", 0.1)
leftaim:TweenPosition(UDim2.new(-0.402, 0, 0.5, 0),"Out", "Quad", 0.1)
topaim:TweenPosition(UDim2.new(0.5, 0, -0.402, 0),"Out", "Quad", 0.1)
bottomaim:TweenPosition(UDim2.new(0.5, 0 , 1.089, 0),"Out", "Quad", 0.1)

wait(0.2)

rightaim:TweenPosition(UDim2.new(0.7, 0, 0.5, 0),"Out", "Quad", 0.1)
leftaim:TweenPosition(UDim2.new(0, 0, 0.5, 0),"Out", "Quad", 0.1)
topaim:TweenPosition(UDim2.new(0.5, 0, 0, 0),"Out", "Quad", 0.1)
bottomaim:TweenPosition(UDim2.new(0.5, 0 , 0.7, 0),"Out", "Quad", 0.1)

Sometimes when I click it stays in the default position, sometimes it gets big, but doesn't go back, because the first animation hasn't ended. Is there a break or something that I can insert at the second section to make the first one stop? (Sorry for bad English, I'm Hungarian)

1 answer

✓ Accepted answer

What you can do, to prevent this from breaking is by setting the Override to true (since it's false by default). This will allow you to make modifications or adjustments to your tweening without breaking anything.

:TweenPosition(Udim2.new(0,0,0,0), 'Out', 'Linear', 0.1, true) -- As you can see, at the end I have put true to allow Overrides.

If you have any other questions, feel free to reply here and I'll try as best as I can answer it.

https://developer.roblox.com/en-us/api-reference/function/GuiObject/TweenPosition

5 comments

0

^ If you read up on that link above, you can read about how Override works if you are still a bit confused with this answer.

0

I have to put the true to all the tweens?

0

Oh it works! Thank you!!

0

Not a problem, have a good one lad.

0

Cool

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