Can you use gameplay abiltiy for player movement?

Hi, I’m trying to disable player movement input while they are performing certain abilities. GAS allows abilities to cancel/block one another through tags.

So is it possible to have the player movement inside a gameplay ability that can get canceled/blocked by other abilities?

Thanks.

In short: use tags.

Gameplay Abilities can apply and remove tags on the player’s pawn so place an “immobile” tag or something similar and check it every time you are trying to move.

Other abilities can add the “unstoppable” tag that prevents skills that apply “immobile” to work or have a skill that removes one or the other.

1 Like

Well, I’ve done it by sending a gameplay event on input, that gets picked up by an ability given to the player character.

I’m taking the Action Value X and Y from the enhanced input action node in the player blueprint and sending those through a Gameplay Event’s payload (using the Event Magnitude float) to the gameplay ability, which, upon receiving the Event, fires the AddMovementInput nodes. Scale Value being the magnitude value from the event payload.

Now, I don’t know if this is a bad idea. Because sending that Event to the gameplay ability is an extra step done on tick, I assume, as long as the keys are held down.

I can’t perceive any lag compared to the normal way, but please let me know if this is not recommended.

I would advice against fairing gameplay events on each input firstly because it is unnecessary and secondly because it is more convoluted but then…

If it works - it works. Better to do 100 sub-optimal solutions than 1 perfect. You’ll learn more that way.

1 Like

Thanks. The reason I done it that way is because then GAS takes care of blocking/canceling the ability by other abilities through tags.

My only concern is lag. I don’t know how I could measure that though.