Following on from the YouTube Tutorial I found I can move the Player Character around by simply creating a bunch of "Stopping" points where I want the player to be inside the level then after a delay move the Player's controlled actor to the world location of the next point they need to be at. This is where the actor class "Target Point" inside Unreal Engine comes in. This actor class can be placed in the level but upon running the game they will be hidden from the player's view meaning the player will not have to see a large amount of marked locations and instead can focus on the enemies or environment of the level while the engine can still find the world location data of those Target Point actors then set the player characters location to the new data of the target point.
Upon first testing this out by using the "Set Actor Location" node the result has the player camera suddenly jumping between locations creating a very jarring view for the user. To smoothen this transition out between the old location data and the new location data I can instead use the "Simple Move to Location" node within Unreal Engine and set the Target Points location data as the "Goal" vector, using this node the engine will slowly move the player's camera from point A to point B (both points being decided by the Target Points location data inside the level).
If you continue to add new location data at the end of the execute path of this code then the player will no longer slowly move towards Target Point 2 for example, they will instead skip Target Point #2 and move between their current location towards Target Point #3. This is not good as I am looking to have control over the players movements and it is not ideal to have them start the level then immediately walking through walls (or colliding with walls) in an attempt to b-line it for the very end location of the level since I intend for both enemies and event sequences to interrupt the players path mid-way through the level and at the moment they would not see any of the other events appearing on screen.
To stop the execute path from reaching the end of the instructions without having given the player chance to witness each of those instructions on screen, I have used "Branch" nodes that check whether or not the player is within range of the location data for the previous Target Point and if they haven't gotten close enough to pass this Boolean check, then I use a "Delay" node to create a looping sequence without erroring the engine giving the "Simple Move to Location" node time to finish it's instructions and change that Boolean check from a false state to a true state.
Comments
Post a Comment