some help with moviment issues

hello guys i’m working on a 2.5d game with moviment based on games like dungeons and dragons shadow over mystara or alien vs predator games but being a 3d where the character when moving aroud the scene he only can face left and right even when moving up and down.

well this part i made work, it have a fixed camera where it is moving all the directions but aways facing only left or right.

the issue is something related direct to unreal itself than the moving code i did, i say that because the issue can happens even on a "clean code on unreal.

here the issue, when you have more than one direction pressed at same time it will aways use based on what you are doing, or right or down, based on what are you doing, if you are doing a just 2d moviment where the character move only to left or right it will make the right default direction which means if you are moving the character to right and keep holding right and press left he don’t turn to left he keep moving to right until you release right buttom when he finally turn to left(if you are holding left), the same don’t happens if you go the other way; if you are pressing left and press right while holding left the character actually turns to right and move to right aslong you keep holding right, he will ignore the left holding, if you enable to move up and down the same will happens but with down being the “default” like if you are moving up and press down it will move down, however if you moving down and press up, it don’t go up and keep moving down, it ignore the up command aslong you are pressing down.

it was supposed to anytime you press a new direction he was supposed to "move in that direction and if needed rotate/look at it, like if i’m moving to left and press right when holding left he is supposed to turn right and move right and if i’m holding right and press left he switch to left the same for up and down, what make it worst is which based on what i did to keep him aways looking to right and left it get worst.

in my case if the character is facing left and i just press up without other buttom like left, it “turn to right and move up” it only keep looking to left if i’m holding left while pressing up, then he move up facing left, otherwise he aways tro to look to right if in neutral state going up and down.

here my code:



those 2 first are to make it move up and down while looking at left or right



those 2 are for a “double click run” to make it run when doubling click

which due to the original bug are also having some isses, like while moving to “right” i can trigger a double run to right by pressing left 2 times, because he will keep facing right and don’t turn to left to run.

any help to solve it is welcome, again to be clear the code issue looks like come from how unreal handle the moviment because the issue can be easy replicate even with the default settings, just create a new third person template and move a character to a direction the while holding that buttom try to move it a direct opposite direction and you see.

ok after some more working i’ve managed to fix the character aways trying to turn to right when moving up or down, here what i did:


i’ve added a new branch to check if the x axis is >(greater) than 0, if true then turn the yew rotation 0 rotating it to right, if it’s false just add moviment points.

now i’m still having some issues

1 - still have the issue with having multiple buttoms pressed it still the issu of if i’m press left while holding right he keep moving right and ignore the last press, but if i do the opposite, like while holding left press to right it will turn right and move right.

the same issue for up and down, if i’m holding down and try to press up it keep moving down ignoring the up command, and if i’m press the down, while holding the up, it will move down as it is supposed to do, the problem is right and down, which the moviment keep being locked on those sides, creating the “run” bug where if i press 2 times left while holding right it can run right even if i didn’t press 2 times right, it was supposed to turn left and run not keep right and run, the same goes for down and up.

2 - some tweaks on double press but i can’t be sure if they are not related to the first one, before i can proper move to then, need to fix the 1 then i can proper check the 2.

as i’ve told before any help is very welcome.

Wouldn’t a ‘Stop Movement Immediately’ coming off the ‘Started’ Pin of the ‘EnhancdInputAction IA_Move’ work?
The started pin is always fired first so it should stop all current movement from the key you were holding and switch to the new key.

no dind’t worked, the best what i did was make the character move really slow, almost ultra slow motion but it still moving aslong i’m holding right, left is ignored aslong i’m holding right, only when i release the right buttom it’s move to left, basically right side and up side are totally dominating, when holding more than one buttom.

Another thing which i would love to have worked is a "zoom camera based on how close or far away i’m from the camera like the game will follow the 2d style move then placing a invsible line in the middle of the path, if the character move up above the line it make the camera get a little far away, if the character move down under the “middle line” then the camera zoom in a little like in some old hackslash games like dungeons and dragons.