mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-10-11 18:19:11 +00:00
Added a Move onto next area in crowds :) 👍
read title.
This commit is contained in:
1 parent
11a2af2f5f
commit
8c084b2e01
5 files changed
+70
-100
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user