State Machine Behaviour public variable not assignable from editor?

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

Make sure you have fixed all errors in the console. This will prevent your script compiling properly and variables wont show in editor. If there are no errors make sure you have saved scene and project.

Are you sure you did not create a custom inspector for your class? If i copy&paste the example from the docs, create a new state and add the beahviour i get this:

56418-attackbehaviour.png

edit

Also make sure you named the file that contains this behaviour “AttackBehaviour.cs”.