mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-10-11 18:19:11 +00:00
fix triggers
This commit is contained in:
1 parent
efdde5d30e
commit
4954204e99
2 files changed
+21
-21
No files matched your search
@@ -20,31 +20,31 @@ public abstract class Trigger : MonoBehaviour
|
||||
}
|
||||
|
||||
//checks if player is in range of the trigger
|
||||
private void OnTriggerEnter2D(Collider2D other) {
|
||||
private void OnTriggerStay2D(Collider2D other) {
|
||||
if(other.CompareTag("Player")) {
|
||||
Debug.Log("entered");
|
||||
isActive = true;
|
||||
}
|
||||
else {
|
||||
// else {
|
||||
|
||||
isActive = false;
|
||||
Debug.Log("exit");
|
||||
// isActive = false;
|
||||
// Debug.Log("exit");
|
||||
|
||||
if(forceInteract && repeatable) {
|
||||
hasOccurred = false;
|
||||
}
|
||||
}
|
||||
// if(forceInteract && repeatable) {
|
||||
// hasOccurred = false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// private void OnTriggerExit2D(Collider2D other) {
|
||||
// if(other.CompareTag("Player")) {
|
||||
// isActive = false;
|
||||
// Debug.Log("exit");
|
||||
// }
|
||||
// if(forceInteract && repeatable) {
|
||||
// hasOccurred = false;
|
||||
// }
|
||||
// }
|
||||
private void OnTriggerExit2D(Collider2D other) {
|
||||
if(other.CompareTag("Player")) {
|
||||
isActive = false;
|
||||
Debug.Log("exit");
|
||||
}
|
||||
if(forceInteract && repeatable) {
|
||||
hasOccurred = false;
|
||||
}
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user