Click-to-Move & Click-to-Attack
MOBA-style input: click ground to move, click enemies to auto attack. Movement is replicated to the server.
- Raycast under cursor to distinguish enemies from ground using gameplay tags
- Enemy clicks activate
BP_AutoAttackthrough GAS - Ground clicks spawn click VFX and request nav mesh movement
- C++ handles local HUD, camera setup, and server-authoritative movement RPC
void AMyPlayerController::RequestMoveToLocation(const FVector& WorldLocation)
{
if (!IsLocalController()) return;
OnMoveRequested(WorldLocation);
UAIBlueprintHelperLibrary::SimpleMoveToLocation(this, WorldLocation);
ServerMoveToLocation(WorldLocation);
}
void AMyPlayerController::ServerMoveToLocation_Implementation(
const FVector& WorldLocation)
{
UAIBlueprintHelperLibrary::SimpleMoveToLocation(this, WorldLocation);
}