Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Tween Reset

Author
Message
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 23rd May 2019 14:21 Edited at: 23rd May 2019 15:16
Hello Community,

Is there any way to reset the TweenCustom variables?

I tried stopping the tweens and then setting the tween custom's variables, but the numbers are not resetting.
For example: StopTweenCustom(4), and then:
SetTweenCustomInteger1(4, 15, 125, 0)
SetTweenCustomInteger2(4, 15, 125, 0)
SetTweenCustomInteger3(4, 30, 255, 0)

Thank you!

EDIT: They stay at 125, 125, 255, which these are the final numbers of the tween.
www.alexmatei.com

The author of this post has marked a post as an answer.

Go to answer

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 23rd May 2019 17:03
This post has been marked by the post author as the answer.
All tweens finish at there final values and stay at that value until they are played again.

You can use the following function to reset the custom tween back to its start value but leave it stopped and ready to play again

function ResetTweenCustom(tweenId as integer)
PlayTweenCustom(tweenId,0)
UpdateTweenCustom(tweenId,0)
StopTweenCustom(tweenId)
endfunction
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 29th May 2019 09:00
Somehow, when I tried to play the tween again, it wouldn't reset, but, your solution helped me!

Thank you!

PS: Maybe I'll post the code, maybe it will reveal why it didn't reset.
www.alexmatei.com

Login to post a reply

Server time is: 2024-04-25 10:54:46
Your offset time is: 2024-04-25 10:54:46