Added a Move onto next area in crowds :) 👍

read title.
This commit is contained in:
Unknown committed 2022-02-26 19:43:26 -06:00
1 parent 11a2af2f5f
commit 8c084b2e01
5 files changed
+70 -100

No files matched your search

+9 -9
View File
@@ -31,18 +31,18 @@ public class WorkingWallTrigger : MonoBehaviour
}
void OnTriggerEnter2D(Collider2D col)
{
float ye = cat.transform.position.y;
float goaly = box.transform.localPosition.y;
if (ye < goaly && counter >= countOffset && col.IsTouchingLayers(layerMask))
{
cam.transform.position -= moveCam;
cat.transform.position -= moveCat;
counter = 0;
}
else if (ye >= goaly && counter > countOffset && col.IsTouchingLayers(layerMask))
float xe = cat.transform.position.x;
float goalx = box.transform.localPosition.x;
if (xe < goalx && counter >= countOffset)
{
cam.transform.position += moveCam;
cat.transform.position += moveCat;
counter = 0;
}
else if (xe >= goalx && counter > countOffset)
{
cam.transform.position -= moveCam;
cat.transform.position -= moveCat;
counter = 0;
}