Hello,
I have been trying to write a state machine behaviour, and after reading the docs it seems pretty clear that public variables should be assignable from the editor. Take a look at this from the docs:
public class AttackBehaviour : StateMachineBehaviour
{
public GameObject particle;
public float radius;
public float power;
protected GameObject clone;
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
clone = Instantiate(particle, animator.rootPosition, Quaternion.identity) as GameObject;
var rb = clone.GetComponent<Rigidbody>();
rb.AddExplosionForce(power, animator.rootPosition, radius, 3.0f);
}
As you can see, there are 3 public variables and none of them are defined. Moreoever, the particle object clearly seems to be a prefab that is instantiated, while the radius and power are floats that I suppose are assigned from the editor too.
What I do not understand is why in my editor there is absolutely no way to assign these variables? I have literally copy pasted the code from the docs and nothing shows up, am I missing something?
Thanks