if (interact.tag == “couch”)
{
interact.GetComponent().enabled = false;
if (interact == GameObject.Find("SilicCouchL"))
{
transform.position = new Vector2(21f, -2.5f);
}
else if (interact == GameObject.Find("SilicCouchR"))
{
transform.position = new Vector2(22.3f, -2.5f);
}
//Right side: 22.3 -2.5
//Left side: 21 -2.5
animator.Play("DusnoSitCouch");
isSitting = true;
while (isSitting == true)
{
if (ClipName != "DusnoSitCouch")
{
isSitting = false;
interact.GetComponent<BoxCollider2D>().enabled = true;
}
}
}
I am trying to make it so that the character can sit on a couch and when they sit on it the collider turns off so they can move to the center of the couch but when they sit on the couch the collider still stays on. Why won’t it turn off?