Question by
KnightRiderGuy · Dec 02, 2015 at 05:04 PM ·
c#animationanimatorscene-switchingstates
Remember If Animation Was On/Off On Scene Switching
I have an animation that plays when a toggle button is pressed but if I exit that scene and then return my animation is no longer playing, How do I make it so that when I return to the scene the animation will be playing or not playing based on it's last state?
public Animator LEDlights;
public void PlayLEDLightsAnimation()
{
LEDlights.SetBool("isPlaying", !LEDlights.GetBool("isPlaying") );
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612051133im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Logic for a lot of animations 0 Answers
Animator displaying wrong states 1 Answer
Movement and Jump with animator 0 Answers