欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

UE4笔记---获取 PlayerController 对象

程序员文章站 2024-03-23 23:58:58
...


UE4笔记---获取 PlayerController 对象

#include "Runtime/Engine/Classes/Kismet/GameplayStatics.h"

// UE4笔记---获取 PlayerController 对象
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GWorld, 0);
ATutorialsPlayerController* TutorialsPlayerController = Cast<ATutorialsPlayerController>(PlayerController);