Okay lemme put it down step by step: (note: this is for GUI)
Make a trigger (obviously) and name it "GUI".
Unit - A unit Starts the effect of an ability
(Generic Unit Event)
(ability being cast) Equal to KnockBack
(Ability Comparison) oh, and "KnockBack" is just some ability I made, insert your own ability here :P
Now add 3 variables:
And set these variable
Set variable Caster = (Triggering Unit)/(Casting Unit)
Set variable Target = (Target Unit of ability being Cast)
Set variable Location = (Position of Caster)
Now make a new trigger, name it "Knock" or "Push" (or whatever)
Time - Every 0.04 seconds of game time
(note: reason for 0.04 seconds of game time - it runs really smoothly and looks epic :P)
Now untick the "Initially On" box, so that it doesn't run forever.
Okay, this trigger only needs 1 action. This is the actual trigger that makes the knockback effect.
Unit - Move (variable TARGET) instantly to Point with polar offset
Now this is kind of the tricky part.
Okay, now take the Location
Make the offset by Arithmetic. You will see:
1.00 + 1.00 - both in blue
Click on the first "1.00"
Make it: Math - Distance between points -
Distance between Location
(Position of Target
Now click the second 1.00 and make it's value 5. (just do it :P)
Now make it "towards (math - angle between points)"
make it Angle from Location
to Position of Target
I'll include a few Screenshots If you don't understand, cause It's rather hard to explain it like this :PP
Now go back to the trigger "GUI"
Trigger - Turn on Knock/push<gen>
Wait - 1.00 seconds
Trigger - Turn off Knock/push<gen>
Why wait 1 second? Cause watching somebody getting knocked back for 10 seconds is pretty lame :P
That's pretty much it! Just wait a sec lemme attach those screenshots.
Hope this helped :)