B站UP谌嘉诚课程:https://www.bilibili.com/video/BV164411Y732
蓝图接口
添加:内容浏览器 右键 蓝图 蓝图接口 新建Doorinterface 蓝图接口  添加canOpendoor 和test函数 test函数添加输入输出参数 
组件添加蓝图接口后可以调用其函数  只有入参没有出参 可以当做事件调用 有出参可以当函数调用使用  使用蓝图接口完成 开关门的操作 门 蓝图  小白人蓝图  给蓝图接口的函数 发消息 调用蓝图接口中的事件并执行
仅适用角色与组件重合即使背对着门也可以进行开门的操作 蓝图接口配合着射线检测就可以避免此类情况
拾取物品-射线检测
新建第一人称射击项目  将武器资源和描边材质放入项目的content文件夹中 打开FirstPersonBP-Map中的关卡 打开FirstPersonCharacter蓝图新建武器拾取功能 图表 添加event tick(vent) 事件触发每帧都会检测 为考虑性能 添加linetracebychannel 对象的线条检测 需要给定起始点和结束点 拖入FirstPersonCamera 引出get world location 玩家摄像机为起始点 引出get forward vector 获取向前向量 添加* 向量*整数 添加+向量+向量 旋转镜头会导致摄像机位置随之变化 将摄像机X Y 位置设置为 0 0  连线  模型对射线通道阻挡  项目设置碰撞中通道添加 默认忽略 只需要将互动的物体对应的物体设置为阻挡即可  选择任意物品查看  新建可拾取物品文件夹 创建蓝图类  选中模型后在蓝图中添加组件快速选取添加该模型 (粉色的为骨骼网格体 蓝色的为静态网格体) 
骨架网格体和静态网格体的区别
骨架网格体有骨骼有动画 静态网格体无骨骼无动画 编译后选中模型 编辑碰撞参数 
新建蓝图接口PickUP_Interation 新建函数 PickUP SetCustomDepthOpen SetCustomDepthClose 类设置添加 PickUP_Interation蓝图接口 新建interation图表  添加 PickUP SetCustomDepthOpen SetCustomDepthClose 事件如果没有编译一下 FirstPersonCharacter 蓝图 out hit节点 引出break hit result 中断命中结果 将event tick 改成F键 连线  
骨架网格体设置碰撞
与静态网格体不同 选择默认选项
 生成的物理资产 
调整胶囊体包裹整个模型  内容浏览器选中物理资产后 点击按钮添加到骨骼网格体中  设置对pickup通道阻挡  对应蓝图中的检测线条通道也需要变更为pickup  添加销毁 destroy actor 后将蓝图类拖入场景中  点击F销毁目标  蓝图接口的多功能性 不同蓝图类设置相同的蓝图接口可以实现相同的功能
|