Scenario:
I have an object that I want to execute 1 or more animations to based on certain scenarios.
I have a fadeIn animation that adjusts the material alpha to fade the object from invisible to visible.
I have a fadeOut animation that adjusts the material alpha the opposite way.
I have a rotate animation that rotates the object.
I want the object to start rotating once a flag is turned on and then stop when it is turned off. This works fine by itself but messes up when using the fading animations.
The fadeIn and fadeOut animations should trigger when requested in code but then not loop nor reset. As in once fadeIn finishes it is in a visible state and stays that way until the visibility/fade state(s) are adjusted. Similarly for fadeOut and invisible state.
The problem:
Now, based on what I have read you should be able to simulate this scenario in the animator controller before committing it to code but for some reason it doesn’t want to work. Either it stops rotating for no reason or it fades in and out continuosly.
The questions:
- Is such a scenario possible?
- Do I have to use the Any State transition to each state animation? I have tried this but it didn’t work that way either, so maybe I have misunderstood its use despite all the videos I have watched.
- Can I use the Any State transition to the fadeIn, fadeOut and rotate animations and then have fadeIn move to Visible and fadeOut to Invisible but keep them there with no other animations triggering? This also seems to be ignored and the animations either stutter part way through or constantly repeat.
- Or do I have to make sure that every scenario is monitored in script and the code controls when each animation starts and stops. In which case what is the animation controller for if not to control when the animations are run or not.
If someone recognises these problems and can point me to what is causing them it would be appreciated.
Thanks in advance.