惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - 一粒沙

ue4 FString 中文乱码问题 用户中心 - 博客园 用户中心 - 博客园 [UE4]引用Grabbable接口 [UE4]Grabbable接口 [UE4]接口 [UE4]重构Grab和Drop [UE4]虚幻引擎的C++环境安装 [UE4]Drop,扔物品 [UE4]抓取准备 [UE4]用Format Text进行调试 [UE4]Overlap Event 碰撞事件 [UE4]Skeletal Mesh的碰撞体 [UE4]模拟物理 [UE4]Static Mesh的碰撞体 [UE4]镜像 [UE4]AttachToComponent的AttachmentRule [UE4]Add Offset [UE4]线性插值Lerp
[UE4]Grab抓取
一粒沙 · 2019-03-07 · via 博客园 - 一粒沙

一、关键函数:AttachToCompoent,将要抓取的物品附加到角色手上,让物品跟随手移动,开起来就像是抓取在手里了。

二、取消模拟物理。在开启模拟物理的情况下,AttachToCompoent是不管用的,被抓取的物品只会受物理重力控制,抓取不起来的。

三、创建函数FindGrabTarget,使用GetOverlappingActors(可以设置值获取某一个类别的物品,也可以不设置获取所有重叠的物品)获得跟手重叠物品。

  

 三、使用IsValid判断抓取的物品是否有效,并将抓取到的物品保存到一个变量,供Drop(扔物品)函数使用。

  模拟物理不是Actor的属性,而是Actor中Mesh组件模型(包含Static Mesh和SkeetalMesh)的属性,使用Get Component By Class获取actor中Mesh组件模型,并取消模拟物理(使用Set Simulate Physics方法,Get Component By Class需要先选择Mesh Component才有该方法)。

  AttachToCompoent的Rule选择Keep World,抓取后保留被抓取的物品原来的样子(包括位置、选择角度、缩放)。  

五、没有碰撞体的物品是无法抓取起来的。如果物品有碰撞体,但是依然无法抓取起来,则要检查被抓取的物品是否没有勾选Generate Overlap Events(产生碰撞事件),勾选上这个选项就可以了。同时被抓取的物品的Mobility可移动性要设置为Movable

   

 六、可以看到方块被移动以后,原来的影子还在。原因是方块原来是Mobility = Static,因此引擎给该方块构造的是静态光照(优化性能),改成Movable以后要,要重新烘焙,游戏运行中,再次抓取并移动这个方块,就不会产生影子问题了。