Crowds level basically finished

Helping zoe next on her camera change!
This commit is contained in:
Unknown committed 2022-02-26 20:44:14 -06:00
1 parent 8c084b2e01
commit 61a7f5984b
3 files changed
+4626 -21

No files matched your search

+4 -4
View File
@@ -8,8 +8,8 @@ public class WorkingWallTrigger : MonoBehaviour
public GameObject cat;
public BoxCollider2D box;
private int counter = 0;
[Range(1f, 25f)] public float camOffset = 10f;
[Range(1f, 15f)] public float catOffset = 5f;
[Range(-25f, 25f)] public float camOffset = 10f;
[Range(-15f, 15f)] public float catOffset = 5f;
[Range(5, 180)] public int countOffset = 10;
private Vector3 moveCam;
private Vector3 moveCat;
@@ -33,13 +33,13 @@ public class WorkingWallTrigger : MonoBehaviour
{
float xe = cat.transform.position.x;
float goalx = box.transform.localPosition.x;
if (xe < goalx && counter >= countOffset)
if (xe < goalx && counter >= countOffset && (col.gameObject.tag == "Player"))
{
cam.transform.position += moveCam;
cat.transform.position += moveCat;
counter = 0;
}
else if (xe >= goalx && counter > countOffset)
else if (xe >= goalx && counter > countOffset && (col.gameObject.tag == "Player"))
{
cam.transform.position -= moveCam;
cat.transform.position -= moveCat;