Dilldoe's Unity animator

Plugins Dilldoe's Unity animator

VamTastic

Invaluable member
Featured Contributor
Messages
465
Reactions
4,899
Points
123
VamTastic submitted a new resource:

Dilldoe's Unity animator - plugin for vam assets with animation

After seeing PluginIdea's CUA Animation Controller
and with Zoidberg's quote for the TLOU Store,
"the Animator controller script (guess
it still flies a bit under the radar since it's not listed under your resources".

I thought i would Release DillDoe's 2019 Unity Animator player controller
as a seperate item from the TLOU Store that it was included with.
it has many functions with playing Audio if the unity asset has it.
just add the plugin to the CUA , you can check my escalator asset as...

Read more about this resource...
 
Hi,

I have a VAM Asset with many animators. This script can only deal with one animator. So I made some changes:

Add this line in Vars at the top
Code:
protected Dictionary<string, Animator> AnimClip = new Dictionary<string, Animator>();

AssetChooser() - Line 331.
Code:
protected void AssetChooser()
        {
            goA = containingAtom.GetComponentsInChildren<Animator>()[0];
            if (goA != null)
            {
                // find animator
                Animator[] animators = containingAtom.GetComponentsInChildren<Animator>();
                if(animators != null)
                {
                    List<string> aList = new List<string>();                  
                    foreach (Animator a in animators)
                    {
                        //  get length of animation
                        if(a.runtimeAnimatorController != null){
                            ac = a.runtimeAnimatorController;
                            // find the animator name from prefab and add to list
                            foreach (AnimationClip state in ac.animationClips)
                            {
                                aList.Add(state.name);
                                AnimClip[state.name] = a;
                            }
                            aList.Add(ac.name);
                            AnimClip[ac.name] = a;
                        }
                    }
                    animT.choices = aList;
                    goA.enabled = false;    // prime it for playback*/
                }
                // find audio
                AudioSource[] aClip = containingAtom.GetComponentsInChildren<AudioSource>();
                if (aClip != null)
                {
                    List<string> cList = new List<string>();
                    cList.Add("None");
                    foreach (AudioSource c in aClip)
                    {
                        cList.Add(c.name);
                        AClip[c.name] = c;
                    }
                    cList.Add("MUTE");
                    audioT.choices = cList;
                }
            }
        }

And AnimChooser(string s) - Line 374

Code:
protected void AnimChooser(string s)
        {   // add choosen animator to label
            pluginLabelJSON.val = s;
            if (goA != null)
            {
                goA = AnimClip[s];
            }
        }

So now you can choose between multiple animators in the same CUA
 
Hi,

I have a VAM Asset with many animators. This script can only deal with one animator. So I made some changes:

Add this line in Vars at the top
Code:
protected Dictionary<string, Animator> AnimClip = new Dictionary<string, Animator>();

AssetChooser() - Line 331.
Code:
protected void AssetChooser()
        {
            goA = containingAtom.GetComponentsInChildren<Animator>()[0];
            if (goA != null)
            {
                // find animator
                Animator[] animators = containingAtom.GetComponentsInChildren<Animator>();
                if(animators != null)
                {
                    List<string> aList = new List<string>();                 
                    foreach (Animator a in animators)
                    {
                        //  get length of animation
                        if(a.runtimeAnimatorController != null){
                            ac = a.runtimeAnimatorController;
                            // find the animator name from prefab and add to list
                            foreach (AnimationClip state in ac.animationClips)
                            {
                                aList.Add(state.name);
                                AnimClip[state.name] = a;
                            }
                            aList.Add(ac.name);
                            AnimClip[ac.name] = a;
                        }
                    }
                    animT.choices = aList;
                    goA.enabled = false;    // prime it for playback*/
                }
                // find audio
                AudioSource[] aClip = containingAtom.GetComponentsInChildren<AudioSource>();
                if (aClip != null)
                {
                    List<string> cList = new List<string>();
                    cList.Add("None");
                    foreach (AudioSource c in aClip)
                    {
                        cList.Add(c.name);
                        AClip[c.name] = c;
                    }
                    cList.Add("MUTE");
                    audioT.choices = cList;
                }
            }
        }

And AnimChooser(string s) - Line 374

Code:
protected void AnimChooser(string s)
        {   // add choosen animator to label
            pluginLabelJSON.val = s;
            if (goA != null)
            {
                goA = AnimClip[s];
            }
        }

So now you can choose between multiple animators in the same CUA
thanks so much mate, i will add you to the script and credit you on the update.
 
i have edited the script but see no difference
there is a line that i blocked off and inserted your version
// protected void AnimChooser(string s)
// { // add choosen animator to label
// pluginLabelJSON.val = s;
// }

protected void AnimChooser(string s)
{ // add choosen animator to label
pluginLabelJSON.val = s;
if (goA != null)
{
goA = AnimClip;
}
}
CUA-animator.png
 
i have edited the script but see no difference
there is a line that i blocked off and inserted your version
// protected void AnimChooser(string s)
// { // add choosen animator to label
// pluginLabelJSON.val = s;
// }

protected void AnimChooser(string s)
{ // add choosen animator to label
pluginLabelJSON.val = s;
if (goA != null)
{
goA = AnimClip;
}
}
View attachment 184604


I don't understand.

Yes there's no difference if you have only one animator in your CUA but if you have multiple animators (like a door, a cabinet, a trash bin) it's useful to be able to animate multiple animators.

I don't use this script to make a simple animation looping but the be able to animate things like doors, windows, etc.
 
I don't understand.

Yes there's no difference if you have only one animator in your CUA but if you have multiple animators (like a door, a cabinet, a trash bin) it's useful to be able to animate multiple animators.

I don't use this script to make a simple animation looping but the be able to animate things like doors, windows, etc.
Sorry mate i must be getting the wrong end of the stick ,
from what i understand, the plugin is for controlling an asset from unity that has animations and animations with sound.
when you say animators do you mean multiple animations in a unity asset ?
as the animator would be the plugin that plays the animations . your right ,frustratingly the original plugin allows to pick an animation
from the asset, but only one at a time.
how does your script edit work to have one plugin to control multi animations from one asset that has more than one animation in it.

maybe you would like to release your version yourself. it would be more useful if it does that.
as it would save the hassle of having multi CUA's with lots of animator plugins
to control one assetbundle with multiple animations .
or you may mean having more animator plugins to one asset to control the multiple animations
 
Last edited:
Sorry.

Sorry. Maybe I'm explaining it wrong, or maybe we're not using this script in the same way. I know you use it to animate a continuously looping escalator. But I have created a bathroom asset with a front door and a cabinet door. I added animations to both doors and with this script I can now control the opening and closing of the doors. Before the changes I could do it only with the door, but now I can do it with both.

If you still don't understand, it's ok, I'll keep the version for myself. I would find it ridiculous to make another version of the script in the HUB just for a few lines.

Have a nice day.


1670554299197.png
1670554523684.png

1670554584379.png
1670555043883.png
 
Sorry.

Sorry. Maybe I'm explaining it wrong, or maybe we're not using this script in the same way. I know you use it to animate a continuously looping escalator. But I have created a bathroom asset with a front door and a cabinet door. I added animations to both doors and with this script I can now control the opening and closing of the doors. Before the changes I could do it only with the door, but now I can do it with both.

If you still don't understand, it's ok, I'll keep the version for myself. I would find it ridiculous to make another version of the script in the HUB just for a few lines.

Have a nice day.


View attachment 184926View attachment 184927
View attachment 184928View attachment 184929
Sorry friend , i not understand why i never got back to you . seems rude of me .
i was looking back at this plugin . i think i may have messed up. but fixed it with adding and replacing lines of your script
how do you control each animation separately ?
 
Last edited:
Has anyone been able to get this plugin to work with the Wearable CUA plugin by Stopper? Wearable CUA is the only way I have found to parent a CUA to a person with an offset (which can be controlled by Timeline). This combination would seem to go well with animated CUAs. However, whenever both plugins are active on a specific CUA, it disappears. It's like the CUA is still there but not displayed. If I reload a save before adding this plugin, the CUA is still gone. I have to exit VAM and restart in order for the CUA to reappear.
Has anyone had this problem, or have any suggestions for me?
 
Back
Top Bottom