I'm tired, I'm sleeping

Hey if someone could expand on this that'd be great I think
This commit is contained in:
Unknown committed 2022-02-26 00:58:16 -06:00
1 parent 8539237c26
commit efd8a2bc3f
5 files changed
+4192 -26

No files matched your search

+5 -3
View File
@@ -11,6 +11,7 @@ public class Ceiling_Trigger : MonoBehaviour
[Range (1f,25f)]public float camOffset = 10f;
[Range (1f,15f)] public float catOffset = 5f;
[Range(5, 180)] public int countOffset = 10;
private LayerMask layerMask;
private Vector3 moveCam;
private Vector3 moveCat;
@@ -19,6 +20,7 @@ public class Ceiling_Trigger : MonoBehaviour
{
moveCam = new Vector3(0, camOffset, 0);
moveCat = new Vector3(0, catOffset, 0);
layerMask = LayerMask.GetMask("Player");
}
// Update is called once per frame
@@ -29,14 +31,14 @@ public class Ceiling_Trigger : MonoBehaviour
void OnTriggerEnter2D(Collider2D col)
{
float ye = cat.transform.position.y;
float goaly = box.transform.localPosition.y;
if (ye < goaly && counter >= countOffset)
float goaly = box.transform.position.y;
if ((ye < goaly && counter >= countOffset))
{
cam.transform.position += moveCam;
cat.transform.position += moveCat;
counter = 0;
}
else if (ye >= goaly && counter > countOffset)
else if ((ye >= goaly && counter > countOffset))
{
cam.transform.position -= moveCam;
cat.transform.position -= moveCat;