No announcement yet.

Direction + button mapping questionion? (Also could be the answer to my directional combat system)

  • Filter
  • Time
  • Show
Clear All
new posts

    Direction + button mapping questionion? (Also could be the answer to my directional combat system)

    So maybe I am over-thinking things right now and there could be a easy solution in the BP by running two inputs at the same time to generate the outcome but basically I'm looking for a little guidance and can not find any tutorial or article (been searching for hours after spending hours trying to come up with the answer myself) so hopefully someone has the answer:

    What I am trying to do is add a mapping to the input controls so that if I press o for example I dodge backwards automatically, but if I press right+o that it will dodge right? I don't know if I am complicating things but it is not allowing me to do this. I first tried just adding a mapping directly into the input of system settings but there was no option for 2 button mapping, and I feel like there could be a easy BP solution but I cannot figure it out-----

    Which my other problem I can not find help with but maybe has a similar solution is directional control of attacks? as in Controlling with the right joystick for example if I want to attack left to right or up to down, or up to right etc etc--- I seen a couple posts and they said to look into physics and the line system but I haven't found anything that actually shows how to make it where I control the direction of the attack by joystick rather than just a normal combo animation.

    Probably a really dumb question for either but if anyone can point me to a tutorial that explains it or give me a hint or help I would greatly appreciate it ! Thanks !

    This may get you in the right direction and I may not be the best to answer this cause my dodges get a smidge complicated in code (and I feel like there's an easier way I just have not seen it yet)....
    Firstly there's "Get MoveForward" and "Get MoveRight" Blueprint nodes...These return Float numbers... Positive numbers are forward or Right respectively to the node negative is the if I'm locked on an enemy I can check these numbers and if they are pushing Right play dodge right, or left depending on the numbers I get back from these...
    Click image for larger version

Name:	Direction Pressed.JPG
Views:	1
Size:	132.3 KB
ID:	1129815
    (In depth note: I compare them to find out which way the player is pressing more as most people aren't robots and don't press the controller in precise manners)
    The movement is handled in the animations which I determine above...The Large problem with this, the camera relative to the players direction...the characters Left may not always be the controllers left....If locked on it is but if that isn't the kind of game you have all the time this step won't work alone...

    so here's where I feel it should be simpler (please chime in if you have the better solution I assume exists)
    Find what direction the player is facing compared to camera
    Click image for larger version

Name:	Direction To Camera.JPG
Views:	1
Size:	250.7 KB
ID:	1129816

    Then compare that to that macro listed in the first picture to break off which animation should play...
    Click image for larger version

Name:	BasedOnFacingDirectionPlayAnims.JPG
Views:	1
Size:	246.9 KB
ID:	1129817

    Gets all kinds of spaghetti real works for me but seems like a lot of work, I suck with rotational and vector math so I assume there's a better solution but if nobody posts one up here and you need to get this in at least it works...
    sorry I could not be of better help...