playMaker

Author Topic: Bool test not working  (Read 1836 times)

maxrostov

  • Playmaker Newbie
  • *
  • Posts: 18
Bool test not working
« on: October 19, 2020, 03:31:17 PM »
Hi,
I've set a Bool Test "isGrounded" in my jump state.

If True, it transitions to the next event. (if False, it stays in the state).

This to make the player unable to "double jump".

But my bool test gets ignored by the FSM (it transitions to the next state, even if Bool is False).

Has anyone experienced this before?

Here's a screenshot: https://ibb.co/sj9sLcd
« Last Edit: October 21, 2020, 02:23:49 PM by maxrostov »

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Re: Bool test not working
« Reply #1 on: October 19, 2020, 05:30:13 PM »
Check Every Frame ?

maxrostov

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Bool test not working
« Reply #2 on: October 20, 2020, 03:44:08 AM »
Check Every Frame ?

When I check it, the player can only jump twice, and then he gets stuck in the jump-animation. It very weird.

See a video of what's happening here: https://share.vidyard.com/watch/seXGdCzvQT52nN2XM32xzP?

Any ideas of why this is?  :-[

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Bool test not working
« Reply #3 on: October 20, 2020, 05:15:11 AM »
Hi.
Do you have a separate fsm that changes the bool 'Is Grounded?

Also you should not use a Finished transition on a bool test, use a custom event name.

When al actions are finished in a state it will send this finished event.

maxrostov

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Bool test not working
« Reply #4 on: October 20, 2020, 06:53:54 AM »
Hi.
Do you have a separate fsm that changes the bool 'Is Grounded?

Also you should not use a Finished transition on a bool test, use a custom event name.

When al actions are finished in a state it will send this finished event.

I only have one FSM with bool check.

I changed from Finished transition to a custom event. It's doing the same thing as the Finished transition did. The problem persist (of course).

Here's a similar set-up on another state in the same FSM that works (see second photo).
« Last Edit: October 20, 2020, 06:56:39 AM by maxrostov »

maxrostov

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Bool test not working
« Reply #5 on: October 20, 2020, 07:04:45 AM »
Here are some screenshots of everything that has to do with Groundcheck and bool test: isGrounded. (the 3rd is in the photo in the post above).
« Last Edit: October 20, 2020, 07:06:54 AM by maxrostov »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Bool test not working
« Reply #6 on: October 20, 2020, 11:12:38 AM »
Hi.
On you jump there is no linecast. so the bool will probably stay false forever.

maxrostov

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Bool test not working
« Reply #7 on: October 20, 2020, 02:39:49 PM »
Hi.
On you jump there is no linecast. so the bool will probably stay false forever.

I added a linecast, and the player doesn't get stuck in the jump-animation anymore! But he can still jump twice (not 3 times).

I found the problem though (unfortunately not the solution):

When the player enters the jump state, the bool test runs before the player leaves the ground. When I press jump/up a second time while player is in the air, the jump state runs again (but the second time the bool test is false since the player is already in the air, so a third jump is not possible).

Here's a video: https://share.vidyard.com/watch/trqPqDUkfzZhVHuagGtvm1?

How do I make sure the bool test only runs after the player jumps?

PS: I tried activating Action Sequence, but the sequence got stuck in the line cast 2d for some reason... (see photo below).

maxrostov

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Bool test not working [SOLVED]
« Reply #8 on: October 21, 2020, 01:59:25 AM »
Problem solved.

I added one more state called "checkGround" - and that's where I've put the Line Cast and Bool check.

In the Jump state i added the action "send event", with a 0.1s delay.

I'm not sure this is the best solution, but it does the job. Since the jump-animation stops playing before player reaches the ground... .

Thank you Djaydino and Heavygunner for your help!
« Last Edit: October 21, 2020, 02:19:21 AM by maxrostov »

maxrostov

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Bool test not working
« Reply #9 on: October 21, 2020, 02:23:37 PM »
Sorry for bothering with this again.
But I can't figure why my jump animation is only playing half the animation...

Here's the video of what's happening: https://share.vidyard.com/watch/phbWFFQNwnzm7kq9Gxsxxa?

In the end i show what the animation is supposed to look like.

Has anyone experienced this?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Bool test not working
« Reply #10 on: October 21, 2020, 02:29:32 PM »
Hi.
Maybe something on your animator transition settings