playMaker

Author Topic: On Collision Enter not working as expected  (Read 2156 times)

kashank

  • Playmaker Newbie
  • *
  • Posts: 4
On Collision Enter not working as expected
« 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.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: On Collision Enter not working as expected
« Reply #1 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

kashank

  • Playmaker Newbie
  • *
  • Posts: 4
Re: On Collision Enter not working as expected
« Reply #2 on: February 01, 2018, 06:43:19 AM »
Sent you a PM with a download link Jean. Thank you for helping me.

kashank

  • Playmaker Newbie
  • *
  • Posts: 4
Re: On Collision Enter not working as expected
« Reply #3 on: February 04, 2018, 10:03:42 AM »
Hi Jean, just checking in to see if you had made any progress.

antibob

  • Playmaker Newbie
  • *
  • Posts: 24
    • BillsClass
Re: On Collision Enter not working as expected
« Reply #4 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.

kashank

  • Playmaker Newbie
  • *
  • Posts: 4
Re: On Collision Enter not working as expected
« Reply #5 on: February 06, 2018, 11:15:30 AM »
Thanks antibob! I will try it out.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: On Collision Enter not working as expected
« Reply #6 on: February 07, 2018, 05:04:47 AM »
Hi,

 is it resolved?

 Bye,

 Jean