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?