Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
SantyWang committed Jul 7, 2024
1 parent 0176ee1 commit a31b632
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/Scripts/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class PlayerController : MonoBehaviour
public Rigidbody rigidBody;
GameMode gameMode;
bool grounded = false;
float initMass = 0;


// Start is called before the first frame update
Expand All @@ -48,6 +49,7 @@ void Start()
animator = GetComponent<Animator>();
animator.SetFloat("run", 1.0f);
rigidBody = GetComponent<Rigidbody>();
initMass = rigidBody.mass;
audioSystem = GameObject.Find("AudioSystem").GetComponent<AudioSystem>();
for (int i = 0; i < initialCrateNum; i++)
{
Expand Down Expand Up @@ -87,6 +89,7 @@ void Update()
Object.Destroy(crate);
});
allCarriedCrates.Clear();
rigidBody.mass = initMass;
for (int i = 0; i < newCount; i++)
{
AddCrate();
Expand Down

0 comments on commit a31b632

Please sign in to comment.