找回密码
 立即注册
查看: 302|回复: 0

UE4如何在C++中实现EnvQueryContext_Player?

[复制链接]
发表于 2022-4-14 21:01 | 显示全部楼层 |阅读模式
如题,在C++里重写ProvideContext函数,为什么如下方式获取不到PlayerController?又该如何实现获取玩家控制角色作为Context呢?感谢解惑
AActor* QueryOwner = Cast(QueryInstance.Owner.Get());
//获取的 PlayerController为 NULL  WHY?
auto PlayerController = UGameplayStatics::GetPlayerController(QueryOwner->GetWorld(), 0);
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-9-22 14:21 , Processed in 0.090079 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表