|
| 10 Feb 2017 04:53 PM |
game:GetService("RunService").RenderStepped:connect(function() -- Flashy animation if SelectedGun == 0 then Selector.Visible = false return false end Selector.Visible = true local TargetSelectorPosition = SelectedGun == 1 and 0 or 70 Selector.Position = UDim2.new(0, Selector.Position.X.Offset + ((TargetSelectorPosition - Selector.Position.X.Offset) / 5), 0, 15) end)
!!?? It should move the selector one 5 of the way closer to it's target each time, but get's stuck at 66 when going from 0 - 70, but always hits 0.
Any ideas?
AutoCarrot// Private Drive - Residents Only |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:24 PM |
oh my god this is a bit painful for me
Can't you use RenderStep:wait() in a for loop for the animation?
or, better yet, use :TweenPosition() ?
http://wiki.roblox.com/index.php?title=API:Class/GuiObject/TweenPosition |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:25 PM |
| Figure it out yourself, Mr. Yale Graduate |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:27 PM |
No, I want to break it half way through, as well as keeping the functionality of making the selector invisible w/o a bunch of conditionals. But I'll do it a different way
AutoCarrot// Private Drive - Residents Only |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:27 PM |
| ^ someone doesnt know what a joke is Downgrading STF ## #################################################################### |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:27 PM |
Also, @Real, I also claimed I was God, so I mean like, I hope you're baiting me now?
AutoCarrot// Private Drive - Residents Only |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:29 PM |
Yes, I'm baiting. But I'm both: 1) Too stupid to figure this out 2) Too lazy to attempt to figure it out |
|
|
| Report Abuse |
|
|
Treeecow
|
  |
| Joined: 10 Jun 2011 |
| Total Posts: 5161 |
|
| |
|
|
| 10 Feb 2017 05:30 PM |
I'd help but I can't for the life of me figure out what this god forsaken line is
local TargetSelectorPosition = SelectedGun == 1 and 0 or 70
I've never seen syntax like this before. |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:32 PM |
| ############################################################ Scroll right down to the ###### ############ ####### Drive - Residents Only |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:32 PM |
Excellent
This was the link: http://wiki.roblox.com/index.php?title=Conditional_statement
Go to the bottom
AutoCarrot// Private Drive - Residents Only |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 05:37 PM |
I always share solutions, but idk how much this will help future people :/
function HandleSelector() if SelectedGun > 0 then Selector.Visible = true if Sequence.Get("GunAnim") then Sequence.Stop("GunAnim") Sequence.Delete("GunAnim") end Sequence.New("GunAnim", .1) Sequence.NewAnim("GunAnim", 0, Selector, "Position", SelectedGun == 1 and 0 or 70, SelectedGun == 1 and 70 or 0, "inCubic", .1) Sequence.Start("GunAnim") Sequence.Wait("GunAnim") if Sequence.Get("GunAnim") then Sequence.Stop("GunAnim") Sequence.Delete("GunAnim") end else Selector.Visible = false end end
AutoCarrot// Private Drive - Residents Only |
|
|
| Report Abuse |
|
|