playMaker

Author Topic: Kickback translate direction on get hit  (Read 1793 times)

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Kickback translate direction on get hit
« on: January 15, 2014, 04:56:22 AM »
Hi,

I got a little issue could use some help with. In my sidescrolling arcade shooter I would like to have a Kick Back effect at the Player as he gets hit by an Opponent Projectile. Now not sure where to start here as I need to get the direction to translate the Player Object on "get Hit" reffering to the opposite Impact Direction. How can i do this in an easy way with Playmaker? Any Idea how to tacle this one? (Objects arent using full physics just Triggers)

greets
Peter

redikann

  • Full Member
  • ***
  • Posts: 174
Re: Kickback translate direction on get hit
« Reply #1 on: January 16, 2014, 12:33:47 AM »
Well I would start by terminating player input long enuff for your kickback to follow thru. If it's a side scroller I am guessing your either Z or -Z for left and right. If you can only be hit from the front then that's easy, just push the player back without flipping him/her 180. If you can be hit from any direction then you have some math to do to figure out where is the player heading to and where is the projectile pushing him/her to.

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: Kickback translate direction on get hit
« Reply #2 on: January 16, 2014, 12:52:13 AM »
Yea, he can be hit from almost any angle in XY Direction, so it looks a little off if I just set him back in one Axis. Im getting a direction from the Collider that the Player got hit by but not sure how to convert this in a simple way into a proper "kick Back" direction translate.