playMaker

Author Topic: Proper way to detect melee attack from player  (Read 319 times)

JOY

  • Junior Playmaker
  • **
  • Posts: 51
  • From JOY Entertainment
    • View Profile
    • JOY Entertainment
Proper way to detect melee attack from player
« on: December 28, 2016, 12:53:10 AM »
Hi,

I'd like to detect the melee attack from my player when the attack enemy. I found 2 solutions:
 - Add collider to the weapon (sword for example) and detect Trigger Event between the weapon and enemy. (I don't know how to add the collider to the weapon yet)
 - Add Animation event in the key frame that the attack was finished --> Send to Player Model FSM --> Continue to send to Enemy FSM

Which one is better? And is there any better solution?

Thanks,
Anh

kavery

  • Junior Playmaker
  • **
  • Posts: 65
    • View Profile
Re: Proper way to detect melee attack from player
« Reply #1 on: December 28, 2016, 07:27:14 AM »
I've only been able to get the first method to work with playmaker - with mostly great results.

When working with a C# programmer we used the second method, which does offer slightly better animation timing accuracy.

I'd like to hear if you're able to get animation events to work using PM.

JOY

  • Junior Playmaker
  • **
  • Posts: 51
  • From JOY Entertainment
    • View Profile
    • JOY Entertainment
Re: Proper way to detect melee attack from player
« Reply #2 on: December 28, 2016, 07:39:37 AM »
Hi kavery,

Yes I was able to get Animation Events using PM. Follow the flow I mentioned above.
Attach the screenshots here.

kavery

  • Junior Playmaker
  • **
  • Posts: 65
    • View Profile
Re: Proper way to detect melee attack from player
« Reply #3 on: December 28, 2016, 08:23:09 AM »
Thanks JOY! Can't wait to give it a try tonight.