What good is this command?

Asked

Viewed 126 times

1

Hi I’m having a question and I need a C# command that activates and deactivates a layer inside the Imator in Unity 3d. This server command for this?

Animator.GetLayerName ("Nadando");

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

1 answer

1

This command returns the name of a layer, and takes as parameter a int, that is to say

(retorna string) GetLayerName(int layerIndex);

What you want best is to change the layer’s "Weight":

SetLayerWeight(int layerIndex, float weight);

You can also disable it with:

minhalayer.enabled = false;

To know the layer id you can use:

(retorna int) GetLayerIndex(string layerName);

I recommend a reading on documentation unity

Browser other questions tagged

You are not signed in. Login or sign up in order to post.