How to make my player to hold his position while pressing a key in top down view?

Hello everyone, this is my first post looking for help!!
I’m currently making a Top Down RPG, using pixel perfect movement.
I’m using finite states machine for my player movement, and i want to add one where the player would hold his position while pressing shift and can still turn to face east, west, north and south directions).
So i need this to make the players choose an strategic location, then hold shift to turn and face the monsters so it can attack them with a spell that only shoots where you are facing.

How would you do it? What behaviours would you use?

I first tried making a state for it (called it shift-state) but it bugs my animations. Using it to deactivate “top down movement” doesnt seem to work, neither Stoping the object or applying desaceleration… I really dont know how to handle that right now.

Im advancing in other areas of development for now but i know i will need help with this sooner or later.

I hope someone helps me and helps everyone that want to implement this to their game.

This is an idea i took from Tibia’s gameplay, if you want to see it, take a look at the first clips of this video (this is a mage hunt) watch?v=Ita_xvqS-9c

Many thanks!!!

I’m assuming you are using the top-down movement behaviour on the player character. If so, the following may help.

In the top-down behaviour settings, uncheck the box for “Default controls”. In your events, you’ll now have to create events with conditions for each directional key press and actions that simulate the keypress. Something like this (I’ve only shown up and right in this example):

So I should not add any new state? You say i would need to edit my Walking state and add those condition checks? I will try, thanks!
(This is my walking state machine, not finished as i dont have all my walking directions animations completed yet)

Nothing is working yet :frowning: I tried MrMen’s solution but it doesn’t work :frowning:

This is my Walking FSM with MrMen’s solution…

What does it do? Does the animation change? Does the character not move when left shift isn’t pressed? Are those events under a parent event?

It doesn’t stop the player, and the animation freezes :frowning:

I think it has to do with Idle state (0, Not moving state), so it kinda confuses my FSMs.

So pressing left shift still causes the player to move? Have you unchecked the “Default controls” in the behaviour settings for Iranon?


That often happens because the animation is changed somewhere else. Look at earlier events and see which one is changing the animation.

If you have trouble figuring it out then, before the animation change in your screen shot, add a debug output action that writes the current animation of Iranon. That can help you narrow down where the other animation change is happening.