For What is this command?

1

Hello, I'm having a question and I need a C # command to enable and disable a layer inside the animator in 3d unity. This server command for this?

Animator.GetLayerName ("Nadando");

In case I want to select the layer "Swimming".

    
asked by anonymous 19.03.2018 / 19:41

1 answer

1

This command returns the name of a layer, and takes as parameter int , ie

(retorna string) GetLayerName(int layerIndex);

For what you want the best is to change the weight of the layer:

SetLayerWeight(int layerIndex, float weight);

You can also disable it with:

minhalayer.enabled = false;

To know the id of the layer you can use:

(retorna int) GetLayerIndex(string layerName);

I recommend reading Unity's documentation

    
19.03.2018 / 19:49