I've got a CheckRotation Node to turn my player when instead of moving directly onto a cell.
However, When facing TopLeft it treats the player as also facing both left and up, meaning they cannot turn those directions to attack an enemy without first turning away and then turning back.
Since you're dealing with 8 directions you want to check for, you can instead use the Check Angle node.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The Check Orientation node basically does the same thing, checking for 90 degree angles (e.g. -45 to 45 for front/north). So, if you want to check 8 directions, you'd check in 45 degree angles, e.g. -22.5 to 22.5 for front/north.
So, for checking back/south direction, you'd need 2 checks, e.g. one range check for 157.5 to 180 and one for -157.5 to -180.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
It is continuous input, but the rotation aspect is not. It ends the action. There is a "lock" button that stops a player from moving if they wish to ensure that they only rotate to a specific position.
I'm not sure what any of that means, but it works?
North: -22.5 to 22.5
North east: 22.5 to 67.5
East: 67.5 to 112.5
South east: 112.5 to 157.5
South: 157.5 to 180 and -180 to -157.5
South west: -157.5 to -112.5
West: -112.5 to -67.5
North west: -67.5 to -22.5
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I found i needed to actually remove the 2nd check, and only have a single angle check of -22.5 to 22.5. Since this is local data, it's taken from character perspective which should always be facing forward, and only actually move once that's true.
Now, regardless of which direction i'm facing, i can turn to face any other direction (where before e.g original question about facing topleft,i can now face both top and left from that position without issue.
But thank you for taking the time to explain these angles to me, it was a real mind twister at the beginning.
The schematic you posted above has all input checks go back to the same Check Angle node. Instead, you need to have the matching angle check for the input you checked for before, e.g. forward/north input checking the north angles, etc.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!