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)
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