Forum rules - please read before posting.

How to check an object's Mecanim parameter value in ActionList Editor?

First off, AC is wonderful and I'm loving exploring its many mechanisms and the functionality it has to offer.

I have a Dumpster (3D object) with a lid that I've animated to open and close. It has an Animation Controller attached that sets the default state to "closed" (a 1-frame animation of it being closed):

Animator Controller showing three states of Dumpster lid

...and uses a Mecanim parameter called "IsOpened" to trigger either the Open or the Close animation:

ActionList action demonstrating ability to set Mecanim parameters

This works perfectly. I can interact with the Dumpster to walk to its walk-to point and open its lid.

Where do I check that object's same parameter, so that I can determine whether I need to send "true" or "false" to this parameter? Right now, all my player character does is open the lid. To close it, I'd have to check if it's already open.

I did a little bit of digging and found that we can link Mecanim parameters to variables. Is this currently the only/best way to achieve this? Or is there a built-in way to check a parameter like there is to set one?

Comments

  • The "built-in" AC way to read an Animator's parameter value is to convert it to a variable (Variable: Set) and then read that (Variable: Check). The above script cuts out the need for the first Action.

    It'd be feasible to write a custom Action that is able to check Animator parameter values directly without the need for a Variable, but the gains vs effort needed would be fairly minimal given the above script.

  • Gotcha, that's all I needed to know. I'm happy to get it done that way. Thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.