从零开始使用TaotokenPythonSDK实现一个多轮对话的智能客服原型
2026/5/15 17:27:03
UNavigationSystemV1::FindPathToLocationSynchronously是一个同步路径查找函数,用于在两个位置之间计算导航路径。它会在当前帧立即执行路径计算并返回结果。
UObject*const FVector&const FVector&AActor*TSubclassOf<UNavigationQueryFilter>UNavigationPath*// 在角色类中使用voidAMyCharacter::MoveToLocation(constFVector&TargetLocation){// 同步计算路径UNavigationPath*Path=UNavigationSystemV1::FindPathToLocationSynchronously(this,// WorldContextObjectGetActorLocation(),// PathStartTargetLocation,// PathEndthis,// PathfindingContext (使用角色自身)nullptr// FilterClass (使用默认过滤器));if(Path&&Path->IsValid()){// 路径有效,开始移动FollowPath(Path->PathPoints);}}如果需要异步路径查找,可以使用:
FindPathToLocationSynchronously的异步版本这个函数是Unreal Engine AI和移动系统的基石,广泛应用于角色移动、AI寻路、自动导航等场景。