Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: HeathClose on April 07, 2017, 07:13:54 PM

Title: Which side was I hit? A knockback question...
Post by: HeathClose on April 07, 2017, 07:13:54 PM
So I have an elevated enemy shooting at my player...

(https://www.dropbox.com/s/quikniy23iw7tm7/pew%20pew.png?dl=1)

the game is a runner... and my player is always moving to the right (except in my picture which I just realized I drew him going left  ::) )... unless of course it is interrupted by knockback... then it keeps moving after it recovers from the knockback...

I have the knockback set to -2.2 on the x and 1.9 on the y...

but what if the player get's hit in the back?  I want the impulse force to change it's direction for the knockback.... and deliver 2.2 on the x instead of -2.2

how can I figure out what side of the player I hit, so if the player is hit in the back... he is knocked forward not backwards... I need a way for the projectile prefab to know whether it's in front of or behind the player on contact.
Title: Re: Which side was I hit? A knockback question...
Post by: jeanfabre on April 10, 2017, 02:05:19 AM
Hi,

 You can put two colliders, on on the left and on the right, deal with the differences and also forward the hit to a general hit manager for all the common tasks.

 Bye,

 Jean