Waypoint Path tutorial
|
- This is a beginner-level tutorial. Also, be sure to check out the Video Tutorial.
In this tutorial, you will learn how to:
- Create a waypoint path within an area
- Create waypoints
- Create a path follower
When completed, you will have a waypoint path which traces a rough circle in the sky, along with an attached object (such as a boat) which floats along it.
Prerequisites
You will need your own Test Area to work in. If you do not have one yet, you should work through the following tutorials first:
- Starting HeroBlade Tutorial
- Area Creation Tutorial
Also, please review the section on Waypoint Paths for an overview of what exactly a Path is, and how it can be useful.
Create a Path
- Move your viewpoint to where you are facing an area that you can place a path. For example, face an object that you placed earlier (perhaps something like a statue), and we will place a "sky path" that moves an object around it. If you're not sure, see Adding a signpost.
- If your path panel is not open, then go to the Editors Menu and choose Paths.
- Note that there are three subsections in this panel: Paths, Waypoints, and Waypoint Info
- In the top "Paths" section at the top of the panel, click the Add button below the list section
- Type a name for the new path, for example, "Skyboat".
- Click on "OK"
- The new path should appear in the list on the Path panel, with an ID #. Click on it to select it.
- Further down in the Path panel, there is a section titled Waypoints.
- Adding waypoints allows you to draw your path in 3D space. Each waypoint is a box and each waypoint box is attached to the previous one.
- Click the Add button below the waypoint section, and a waypoint will be created. It will appear as a diamond in the viewport.
- Note: If for some reason you cannot see the waypoint, check your Visibility Menu and Selection Menu to ensure that "Path" and "Path Follower" are selected.
- In the Waypoint section of the Panel menu, click on the ID# of the waypoint that was created.
- Click on one of the movement tools, such as "Select and Translate",
and move the waypoint around.
- 90% of the time you will want waypoints on the ground, but for this tutorial, place the waypoint somewhere near the statue, at about the height of your character's (or the statue's) head.
- Note: If for some reason you cannot see the waypoint, check your Visibility Menu and Selection Menu to ensure that "Path" and "Path Follower" are selected.
- Once you have your first waypoint in place, click the ADD button to create a second one. You will see it automatically connected to the previous waypoint.
- Now move it around. Place it at about the same altitude as the first waypoint. Do not worry too much about placing waypoints perfectly -- they will be easy to move around later.
- A quick way of placing a waypoint, instead of creating, clicking, and dragging, is to move your viewpoint to approximately where you want the next waypoint to appear, and then click "Add". The waypoint will appear in front of wherever you are looking.
- Another quick way of placing a waypoint is to click and drag a pulsating circle visible when a waypoint is selected. Doing so will place a new waypoint at the position of the mouse cursor. While a waypoint is selected, the selection will change to other waypoints as the cursor hovers near them.
- Set your viewpoint to "Top down" or Overhead View
- Click on the Camera in the top menu bar
- Press "CTRL-O" to toggle Overhead View
- Place another waypoint by clicking on Add
- Press "CTRL-O" to toggle back into camera view
- Place several more (6-20) waypoints, laying a track which is roughly a hexagon and comes around and meets itself (similar to laying train track). The last waypoint should be near the first waypoint but not necessarily overlapping (perhaps a character's armlength away). A quick way to add the last one, is to maneuver your viewpoint to face the very first viewpoint, and then click Add.
Create a Path Follower
Now that you have your path laid out, you will need to attach a follower to the path. The follower will "walk" the path.
- Move your viewpoint away from the waypoints, so that you can see the entire track at once.
- If for some reason the path has disappeared, you can make it visible again by going to the Paths panel, and clicking on the name of the path.
- In the Path panel, near the Add button, click on Create Follower.
- In the ASSETS panel, the follower should show up in the "Pathfollower" section.
- It will be in the top box.
- You may need to click on the "+" sign next to PATHFOLLOWER
- You should see a
follower.fol
asset
- In the Assets Panel, click on the follower.fol asset
- In the "Instances" section of the Assets panel, you will see a string of numbers that defines where the follower is located in 3D space.
- In the Assets Panel, select the instance of the follower. This will make it show up in the viewport, as a yellow box with a white diamond in the center.
- You may need to move your viewpoint around to find the follower. It will be surrounded by a yellow box, but may not be anywhere near the path that you just created.
- Examine the follower's Properties.
- If not already open, go to the Editors Menu and choose the Properties panel.
- If the follower is not selected, click on its instance again to find it (see the above steps)
- Under "path", the Follower should have the name of the path that you just created.
- Start the follower moving.
- In the follower's properties, you will see one labeled
speed
. Right now it should be blank (the follower is not moving).- When the follower is moving, it moves along the path. If it is not on the path, its first goal will be to get to the path.
- Change the follower's SPEED to 1.
- Note: You may also need to set PAUSE to FALSE.
- In the follower's properties, you will see one labeled
- The follower should now starting moving around the path. Depending on how closely spaced the waypoints are, this movement may be unusual. The follower might get stuck at a waypoint, or start spinning around one in close circles, or veering far off the path. These are all normal behaviors which can be modified later.
- Stop the follower
- In the follower's properties, click on the word
False
next to thePause
property. This will give you a dropdown box. Select TRUE. - This technique can be used to start and stop the follower as necessary.
- In the follower's properties, click on the word
- Start the follower again (set
Paused
to FALSE), and adjust some of the other follower behaviors (this can require some experimentation). Adjust each of these behaviors one at a time, and observe how they change the follower's movement, especially around corners.- Set the Waypoint Tolerance to .1
- Set
Speed
to .5 - Set
Speed
to 10 - Set
Speed
to 5 - Set
Waypoint Tolerance
to .01
- Depending on where your waypoints are set, you may notice that the follower "jumps" from the last waypoint to the first one. This can be configured with the "End_Behavior" property.
- Feel free to experiment with other follower properties
- Link the last waypoint to the first one
- Set the follower to "pingpong" or to stop at the last waypoint.
Attach an object to the follower
Playing with the follower may be fun, but this movement is only visible to the GameMasters. Now we're going to attach something to the follower, to make something actually change in the game world that would be visible to a player. In this case we are going to attach a boat.
- Go through the asset library, and find some other object to use as a follower (for example, a small boat). Place it in the game world, near the start of the path.
- If you are not sure how to place an object, be sure to work through the Starting HeroBlade tutorial
- Create a relationship between the follower and the boat. The boat will then be a child node of the follower, and the follower node will be a parent node of the boat. Wherever the parent node goes, the child node will go as well.
- Find the GUID of the parent node (in this case, the follower)
- Examine the follower's properties
- Select the Follower and look at the Properties panel
- Write down its GUID number, or copy it to the clipboard
- Examine the follower's properties
- Examine the properties of the boat
- Select the boat, if necessary via its asset instance
- Look at the Properties panel
- Under PARENTINSTANCE, write or paste in the GUID of the follower
- The boat should now move around connected to the follower
- Find the GUID of the parent node (in this case, the follower)
- Move the boat and follower closer together
- You may notice that the boat isn't following the follower around perfectly and it is some distance from the follower, connected via a white line. If this is the case:
- Pause the follower
- Either set PAUSED to TRUE, or its speed to 0
- Select the boat, move it to where it is overlapping the follower, and rotate the boat so it is facing the proper direction on the path
- Restart the follower (set PAUSED to FALSE, or increase its speed)
- The boat should now move along the path, in the proper orientation
Well done!
- Feel free to play with other of the properties on the follower to see how that changes things.
- Change DeltaRotation3D on the Path Follower. Note that if you only modify the Z-axis, it will cause the follower to spin
- Also, click and drag some of the waypoints around, to change the shape of the path, and watch how the boat continues to follow. For example, try to make hills and dips like a rollercoaster.
What to do next
Create a path in preparation for the next tutorial, on creating a script. It should have six waypoints in a roughly hexagonal shape, and a follower node which traces along it.
- Create a path with a grid size of .5, six squares by seven squares
- Position the path four "levels" above the ground.
- Path Follower properties:
- Path:
testPath
- Speed:
1
- TurnRate:
1
- End_Behavior:
Go_To_First_Waypoint
- Path: