I am trying to make a character move in a level back and forth in a straight line using the AI controller. I have added a nav mesh volume that shows which area the person is allowed to walk in but rn, it’s very random and I want to make it a straight direction. How can i do this?
On begin play you save your pawns location to a variable (Initial Position)
Then you take the direction the character is facing (forward vector) and multiply by the distance you want it to move and add the initial position.
When the move to location node fires it is getting the goal location from the select node and since the bool coming from flip flop node by default is false it will return the Checkpoints location. The next time flip flop node fires the “Is A” bool will return true and the select node will pick Initial position to be used for Move To Location node.
But keep in mind that this doesn’t check if it’s a valid location.