playMaker

Author Topic: Character is able to jump undesirably midair (SOLVED)  (Read 1632 times)

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Character is able to jump undesirably midair (SOLVED)
« on: August 10, 2016, 04:21:10 PM »
I use Add Force 2D to get character jump (in platformer game), however I don't want it to be able jump midair too. Any idea how to tackle with that?
« Last Edit: August 11, 2016, 08:55:44 AM by Just »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Character is able to jump undesirably midair
« Reply #1 on: August 10, 2016, 04:28:43 PM »
You want to check if the character is grounded before jumping again- there are many ways to check if a character is grounded using casts, triggers, or if using a character controller there is a built in isGrounded check-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Character is able to jump undesirably midair
« Reply #2 on: August 11, 2016, 08:50:36 AM »
Collision2D Event did the trick for me. Basically I tagged every floor object and now with collision it detects whenever you're on the floor or not. Thank you!