ambiguity error?

Hi my code is the following:

using UnityEngine;

public class Wristwatch : MonoBehaviour
{
    public Animator animator;
    public Transform tf;
    public bool walking, testtrigger;
    float currx,curry,stepx,stepy,totalxy,desxup,desxdown,desyup,desydown; //e.g. desyup = upper limit of desy
    public float desrange, speed;
    void Update()
    {
        //Grab positions for easy calling
        currx = tf.position.x;
        curry = tf.position.y;

        //Update Anim Parameters
        animator.SetBool("Walking",walking);

        //Manage Movement
        if(Between(currx,desxdown,desxup) && Between(curry,desydown,desyup))
        {
            walking = false;
        }
        if(walking)
        {
            tf.Translate(new Vector3(stepx * speed,stepy * speed,0f));
        }

        //Temporary Test Trigger
        if(testtrigger)
        {
            StartMoving(-0.5f, 3f);
            testtrigger = false;
        }
    }
    public void StartMoving(float desx, float desy)
    {
        //Calculate Step
        totalxy = (desx - currx) + (desy - curry);
        stepx = (desx - currx) / totalxy;
        stepy = (desy - curry) / totalxy;
        walking = true;

        //Calculate Limits
        desxup = desx + desrange;
        desyup = desy + desrange;
        desxdown = desx - desrange;
        desydown = desy - desrange;
    }
    public bool Between(float x,float min,float max)
    {
        if(x < max && x > min){return(true);}else{return(false);}
    }
}

and i get ambiguity errors on every single variable.
normally this would indicate to me that there is a duplicate script somewhere, but i have searched the entire project and there is nothing. i am using unity collab, is that the issue?

can you show the exact error and the lines for which it is reported?

1 Like

This is an excellent first diagnosis. Another way this can happen is if an old assembly does not properly rebuild itself. You can try remediate this by right-clicking in the Project window and doing a Reimport All.