playMaker

Author Topic: Bug with jumping [SOLVED]  (Read 2399 times)

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Bug with jumping [SOLVED]
« on: October 04, 2016, 03:19:02 PM »
I have platformer, for jumping I use Bool-value to check whenever I'm on the air or not (so you can't do midair jumps).

Practically it checks it by whenever I press Spacebar to jump, Bool for being on the air becomes true. And when Collission 2D Event collides on the ground, Bool-value for being on the air goes off.

However, Collission 2D event activates whenever I touch the ground, and not necessarily for being ON the ground. Practically it means I can jump besides floating platform midair, which is what I do not desire.

There is one other bug caused by this. Dropping down from cliff doesn't activate "on the air" bool-state, and thus I can't make walljump.

I demonstrated bug and my current setup on video to clarify how it works for me currently:


« Last Edit: October 13, 2016, 09:21:23 AM by Just »

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Bug with jumping
« Reply #1 on: October 06, 2016, 12:33:21 PM »
Good news: I managed to solve no walljumping via falling down. All I needed was just add "on air" bool during being on air state, I simply forgot that state can happen without actual jumping. I had that bool check during jump state only silly enough.

Now I have one more bug to tackle, and that is the aforementioned able to jump midair beside collission which I wish not to happen. I figured I probably should replace Collission 2D Event with something else, but what...?

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Bug with jumping
« Reply #2 on: October 06, 2016, 07:17:53 PM »
OK, so I found Get Speed and Compare Float states to see if speed is 0 to determine object being on the ground. However, I can't seem to find it being able to regard Y-axis only. Is that possible?

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Bug with jumping
« Reply #3 on: October 08, 2016, 06:57:25 PM »
To continue my monologue, it seems using Get Speed and Compare Float didn't work way I would have desired.

My next approach to solve issue is to use collider tags to apply very small layer besides platforms to prevent midair jumping happening by player touching side of platform. My idea is to use tags seperate from the rest so collider won't react other way than being solid obstacle.

That is pretty simple solution even though pretty tedious to apply each and every one of colliders on side. I'll come back here to tell how did it go.

Just

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Bug with jumping
« Reply #4 on: October 13, 2016, 09:21:06 AM »
I can confirm using separate tags for side of platforms indeed work. Now character can't jump anymore midair from side of platform, which is splendid.

To clarify further for someone who might have similar problem in future, I added thin platform with colliders (but without sprite so it's basically not visible in the game) beside actual platform and I seperated it's tag from my actual platform so jumping doesn't activate. However, added platform is thin enough that collider platform tag still activate while standing on the actual platform, so it won't activate when being on air and touching platform from the side.
(I underlined for further emphasing my point how it works)

Hopefully my explanation was clear enough for someone needing that information.

I'll mark this thread solved.
« Last Edit: October 13, 2016, 09:37:54 AM by Just »