fixed tambourine

such a stupid issue omg i can't believe it took me this long to realize what was happening. also added transition music into the caverns
This commit is contained in:
Sam
2023-05-06 17:16:35 -07:00
parent 726ef3d1be
commit a757a47af1
8 changed files with 212 additions and 90 deletions

View File

@@ -8,7 +8,7 @@ public class PlayerBehavior : MonoBehaviour
[Header("Physics:")]
private float _hInput;
private Rigidbody2D _rb;
private int forward = 1;
[HideInInspector] public int forward = 1;
public PlayerInput playerInput;
[Header("Tambourine:")]
@@ -382,9 +382,16 @@ public class PlayerBehavior : MonoBehaviour
// destroy all tambourines
GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine");
foreach (GameObject tambourine in currentTambourines) {
tambourine.GetComponent<TambourineBehavior>().DestroySelf();
// Destroy(tambourine);
print("tambs found: " + currentTambourines.Length);
if (currentTambourines != null) {
foreach (GameObject tambourine in currentTambourines) {
if (tambourine != null) {
tambourine.GetComponent<TambourineBehavior>().DestroySelf();
print("tamb destroyed");
} else {
print("null tamb");
}
}
}
StateController.Instance.RespawnPlayer();