Trying to get the player to move between waypoints

Hello,
I have been trying to make the player (not an AI actor) move to a waypoint and then continue on to another waypoint after that. In addition, I want some of the waypoints to give an option to choose the next waypoint. So essentially I am creating multiple paths that the player can choose from. The player has no direct control over the character’s movement.
I would appreciate any help in how to set this up in blueprints. I would rate my blueprint experience as beginner so the more detailed any advice, the better chance I have of understanding it.
Thanks in advance for your time.

Hello NickleSlick,

Assuming you have your waypoint locations set, you can use Simple Move to Location node. I set it up just now. I have an array of 4 vector points in the world and when the event (patrol) is fired off, my character will move between the points specified in the array, each time having a little delay before moving to the next point. Once I reach my final point I reset to the first one and the cycle goes on.
In regards to control which way to go next, I would use an overlap/trigger to detect the player and then have it display message or widget so you can choose your next point.
I haven’t set up this part yet but it shouldn’t be that hard to do.

if the player has no direct control of movement then you don’t really even need to posses it, you could treat it as a ai. think of it like a god game, the player is actually the player controller (the god) and the character is just a husk that the god controls. so really all your system needs to do is to tell the character move from here to here and any other aspect of the game can be handled by the controller.

I;m thinking of your situation like a point and click adventure but instead of clicking where you want to go you have set locations that come up as buttons in a widget.

Heres an example of what i was mentioning and it shows how you could handle the waypoints / ui buttons. This setup will also work with a possessed character you will just need to use the simple move to, you will also need to mess with your characters characters movement component in this case (orient to movement option i would think).

the first thing you will need is a reference to the character, for this example i made a variable in the player controller called ControlledChar. We also need a waypoint actor (cover this in a min)

next we need two widgets. the first widget (W_waypointList) will be a container for all the waypoints to be listed so just add a scrollbox or vertical box and make sure its variable. then create another widget (W_WaypointSingle) and add a button and add a text component as its child, also add a variable which will be a waypoint actor reference. for the buttons on click event as shown in the below picture, basically get the reference to the character to be moved, then do a move to, and last get the widgets parent and remove from parent to destroy the widget. This is where your movement is handled.

Next I made the waypoint itself an actor so it will be easy to create many instances quickly and easily. this actor consist of a collision box. We also need a variable here whos type is this actor, make it a actor reference, and an array, oh and make it public. This array will contain the destination waypoints from this waypoint, once its placed in the world you just select it and in the details panel set references in the array. The overlap event here is how we will create the widgets. on overlap we make sure it was a character via a cast, then we create the main container widget and add it to the viewport. next we need to populate the container so we take our array and for each index we create a new widget (widgetSingle). we then get the widgets destination variable and set it from the array index. last we get the scrollbox of the container and add the new widget as its child.

hope that helps with the ui bits at least

Yes I did put it inside the character. Good luck. :slight_smile:

Thank you very much for your reply,
Did you add the functionality to the player character or the level blueprint?

Thank you very much for this detailed response,
This gives me a lot of options as I go back and try and figure things out! I will let you know how it goes.

Hello, I was finally able to get this working based mostly on what you posted. For some reason the AI MoveTo would not work for me so I used the Simple MoveToActor node. One thing that tripped me up a bit (although I should have known better) was that I needed to add NavMesh. For some reason I completely forgot about that. Thank you again for your help.

As a side note. I have no idea how to mark a comment as an answer.