Skip to content

Commit

Permalink
sorry super stinky
Browse files Browse the repository at this point in the history
  • Loading branch information
mdobinda committed Apr 11, 2023
1 parent 715e418 commit e01c088
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions Assets/GravityField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ void Start()
m_collider.isTrigger = true;
}

// protected virtual void OnTriggerStay(Collider other)
// {
// if (other.CompareTag(GameTags.Player))
// {
// if (other.TryGetComponent<Player>(out var player))
// {
// if (player.isGrounded)
// {
// player.verticalVelocity = Vector3.zero;
// }

// player.velocity += transform.up * force * Time.deltaTime;
// }
// }
// }

// if(other.gameObject.CompareTag("Collectable"))

void OnTriggerStay(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
if (other.TryGetComponent<PlayerMovement>(out var player))
{
if (player.OnGround())
{
// player.SetVelocity() = Vector3.zero;
}

// player.velocity += transform.up * force * Time.deltaTime;
}
}
}

// Update is called once per frame
void Update()
Expand Down

0 comments on commit e01c088

Please sign in to comment.