Creating A Shove Action


  • Posts: 9
I'm trying to construct a shoving motion in a game using 4 way movement. The shoving motion in it's ideal form should work automatically when the main character interacts with a enemy character when a button is held down- shoving the enemy character in the opposite direction or at least out of the way for a bit.

I'm running into trouble though with:
A. setting off the action with a button when the collision occurs
B. getting the animations to play that correspond to the direction of the collision
C. getting the enemy actor pushed in that direction.

At present the behavior is only on the player actor, used to interact with all actors.
I tried the core pushing actions without problem 'A' involved, but still ran into problems 'B' and 'C'.
Also, it seems to randomly play but usually when it does the player actor is pushed into blocks that do not have a collisions set- which means I get thrown from the territory I'm supposed to walk in.
I'd be glad to upload a active example, but here's what the pushing code looks like at present.