Hey GiL,

I'm trying to set up diagonal movement, using WASD. I've got the orthogonal directions working well, but everything i'm trying for diagonal movement just actions the orthogonal direction instead.

Is there a proper way i should be doing this?
  • That's just be checking in the schematic for both horizontal and vertical input (or Vector3 X and Y axes when using Directional Joystick Input node) and selecting a cell accordingly.

    Basically just a series of input checks, e.g. first checking horiziontal (or X axis) for going left, right or no input, afterwards checking vertical (or Y axis) for going up, down or no input (and do that for each case of the horizontal check, so, left, right and no input will each have their own vertical checks). The combination of both results (e.g. left+up is left up diagonal, while none+down is just down) need to use the correct cell and handle movement as usual.

    Such a setup might be best with having a single movement action that's started by any directional input and handles the direction as described above. So no up/down/left/right move actions :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks, I've sorta got that working (only the H/V input - not vector 3 yet, giving up on that until the end) But my Grid Rotate to Target only rotates orthogonaly, so e.g i can only move diagonally down left when my character is facing down, not when they are facing left.

    image

    image
  • edited June 13
    I'd recommend to use the Machine Object in the Grid Rotate To Target node, using Player will use the player in any case, e.g. even when that action would not be used by the player.

    Anyway, might be the wrong cell selected - can you show the settings for the node selecting the cell? Or might be input checked wrong and selecting the wrong cell based on that. You can use Unity Console nodes to add debug output, or use live debugging of the schematic to see what's happening.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Sure, here's the cell selection, and the overall schematic
    image

    image
  • Looks correct overall ... are you using Diagonal Distance 1 in your square grid settings (Battles > Battle Grid Settings)?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I......am not.

    That's fixed it. *Insert Homer Simpson D'Oh*

    Thanks for always willing to help.
  • No worries - might be a bit obscure, but having diagonal distance 1 is required to have diagonal movement and rotations in square grids :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.