Unity Animation Parameter Not Changing

Hi, I’m relatively new to Unity and I am completely stumped by this. I currently just have two states, GuyOne and GuyTwo. They have a transition between them, so that if the parameter is equal to 2, it should switch. If i use my code and have it switch to 2 in the update function, the animation immediately switches to GuyTwo, which tells me that it works. However, if I try to make the animation switch to an integer variable instead of 2, the animation never switches, even if I click a GUI button that switches the variable to 2. The Debug.Log always outputs 2 when I click the button, but the parameter never changes, no matter what I try.

I’m hoping to make it work so that the parameter changes on the button click and it doesn’t have to check for it in the Update function, but right now I’d be happy with anything. Any help is greatly appreciated, thanks!

var mashers : float = 1;
var mashMultiplier : float = 1;
var masherUpgradeCost : float = 1;
var bodyLevel : int = 1;
var anim : Animator;

function Start () {

	anim = GetComponent(Animator);


function Update () {

	anim.SetInteger("currentBodLev", bodyLevel);


function upgradeMasher(){
	if(mashers > masherUpgradeCost){
		mashers = mashers - masherUpgradeCost;
		mashMultiplier = mashMultiplier * 1.5;
		masherUpgradeCost = masherUpgradeCost * 2;


I figured it out! I somehow had two of the same script component on the same object. It must have messed something up. It’s working now!