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
@@ -24,6 +24,8 @@ public class NPC : MonoBehaviour
{
delay = Random.Range(minDelay, maxDelay);
horizontalMove = horizontalMove * runSpeed;
leftBound += controller.transform.localPosition.x;
rightBound -= controller.transform.localPosition.x;
}
// Update is called once per frame
@@ -42,10 +44,10 @@ public class NPC : MonoBehaviour
animator.SetBool("Airborne", !controller.m_Grounded);
}
elapsed += Time.deltaTime;
if(transform.position.x > rightBound) {
if(transform.localPosition.x > rightBound) {
horizontalMove = -1 * runSpeed;
}
if(transform.position.x < leftBound) {
} else
if(transform.localPosition.x < leftBound) {
horizontalMove = runSpeed;
}
}