I’m trying to add animations to an fx controller script, and unfortunately I’m having trouble working around (or with) the animation controller.
I’ve already got a controller that controls various fx (such as audio, particles, lens flares, trails, visibility) based on various states of an object, like health, throttle, alive, dying, and a host of other parameters.
It’s pretty straight forward. You drag and drop the effect, and then you can assign a condition when the effect is to be active.
I’d like to add some simple animations to the mix as well. (like parts opening and closing)
At it’s most basic, it would look like this:
Drag and drop the animation into the controller, and when the monitored value is true, play the animation. When it’s false, play the animation in reverse.
But I’m fighting with the animation controller. There doesn’t seem to be any way for my script to know what variables an arbitrary animator controller is using without a lot of hard coding, so there’s no good way to link control.
And the thing is, I don’t really need a state machine; I’ve already got one. And having two of them to monitor the same thing seems like a waste.
Is there not a simple way to just play an animation clip on a specific object? Without having to create a whole state machine every time?
Alternately, however, I can see the use for some of the more complex states, and transitions. So, ideally, I’d like to be able to integrate with an animation controller in a generalized way. That is, without having to hard code each one.
I’m new to Unity’s animator, but all the tutorials I’ve seen haven’t been relevant to what I’m doing.