private void Start() { var movement = new ActionState("Walking", () => Rigidbody.velocity = input.Movement * speed); var hiding = new ActionState("Hiding", () => Rigidbody.velocity = input.Movement * speed * .5f); movement.AddTransition(() => input.Hide, hiding); hiding.AddTransition(() => !input.Hide, movement); movementMachine = new StateMachine(movement, DebugBlock); }