Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kashank on January 31, 2018, 12:59:24 PM

Title: On Collision Enter not working as expected
Post by: kashank on January 31, 2018, 12:59:24 PM
Hi all,

I'm trying to setup a wall-jump FSM but it's not working as expected, specifically, the collision detection does not function as expected.  What I'm trying to achieve is the player cube FSM to be in either 'On right wall' or 'On left wall' state depending on the wall it's touching (determined based off of the tag of the object the player cube is colliding with). Instead, the FSM is almost always in the 'Collided' state. On initial jump, the cube jumps to the right wall (the jump portion of the FSM works fine), but when the cube hits the wall, the state goes back to 'Collided' and stays there. There are times when the cube will actually get to 'On right wall' state, but I have to "catch it" in that state, it flips in and out very fast and seemingly at random.

Even on initial scene start, the cube falls onto the ground, which is untagged, but stays in the 'collided' state instead of going to the 'start' state as I think it should.

I've uploaded an image of how the FSM is setup, as well as an image describing the scene setup (as far as tagging is concerned), and two more images which display how the 'collided' state is setup and illustrate that the cube is constantly in 'collided' state.

All help is appreciated.

Title: Re: On Collision Enter not working as expected
Post by: jeanfabre on February 01, 2018, 12:40:51 AM
Hi,

 can you send me that scene as a package? I'll repro locally and check what's going on.

 Bye,

 Jean
Title: Re: On Collision Enter not working as expected
Post by: kashank on February 01, 2018, 06:43:19 AM
Sent you a PM with a download link Jean. Thank you for helping me.
Title: Re: On Collision Enter not working as expected
Post by: kashank on February 04, 2018, 10:03:42 AM
Hi Jean, just checking in to see if you had made any progress.
Title: Re: On Collision Enter not working as expected
Post by: antibob on February 05, 2018, 03:54:17 PM
Use Get Collision Info and Compare Game Object with Tag instead of using the collision event action.

Or take off the global event and move the wall detection loop to another state machine.
Title: Re: On Collision Enter not working as expected
Post by: kashank on February 06, 2018, 11:15:30 AM
Thanks antibob! I will try it out.
Title: Re: On Collision Enter not working as expected
Post by: jeanfabre on February 07, 2018, 05:04:47 AM
Hi,

 is it resolved?

 Bye,

 Jean