RTS Multiplayer Game Series

4.Unit Navigation & R Click for Moving



Open RTS interface, add 2 functions:
With input and output on each:
image.png
image.png

Open Marquee HUD BP, click Grab Selected Units in Interface column
image.png

Go to Parent Unit class, event graph
image.png

Go to RTS controller BP, set R click mouse button for moving graph:
Right Click location variable is renamed by promote location variable to break hit result

image.png

Now the move only 1 spot, and all selected objects move to that same spot. (not solvable in this tutorial)

Also, movement will be blocked if the character has to pass through other characters.
To fix this, go to Parent unit class → its root component
change AI controller class to detour crowd ai controller
image.png

Navigation bound fixing (When character move to place where not covered by nav mesh bound area)
image.png
Go to Project setting
reduce max step height from 35 to 12, see the green area diff than the image above
image.png
image.png
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.