Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] AnimatorParam does not work if you assign an override controller to the animator #394

Open
anas-rg opened this issue Dec 12, 2024 · 1 comment

Comments

@anas-rg
Copy link

anas-rg commented Dec 12, 2024

As the title says.
I am assigning an AnimatorOverrideController to the Animator component. But as soon as I do that the Animator Param stops working i.e. does not show the variables list. Instead gives me a warning that the Animator is null.

image

@TylerTemp
Copy link

TylerTemp commented Dec 12, 2024

Sadly NaughtyAttributes has not been updated for years with pending PRs...

You can use SaintsField as an enhancement of NaughtyAttributes, to get this thing work without migrating your existing code:

public Animator animator;

// NaughtyAttributes' version
[NaughtyAttributes.AnimatorParam(nameof(animator)), NaughtyAttributes.InfoBox("NaughtyAttributes' version:")] public int treasureOpenAnimTrigger;
// SaintsField's version
[SaintsField.AnimatorParam, SaintsField.InfoBox("SaintsField's version:")] public int treasureCloseAnimTrigger;

// you can combine SaintsField with NaughtyAttributes
[NaughtyAttributes.BoxGroup("Animator"), SaintsField.AnimatorParam] public string animName;
[NaughtyAttributes.BoxGroup("Animator"), SaintsField.AnimatorState] public SaintsField.AnimatorState animState;

The animator override controller looks like this:

image

And the result:

Unity_D15PpUpCAh.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants