UE学习记录part18
225 animation blueprint templates: generic animation blueprints
在Animation Blueprint中选择template生成动画蓝图模板
在function中选择blurprintthreadsafeupdateanimation,用于做数据的更新
先创建变量,再将变量再blueprintinitializeanimation中设置值
利用property access节点,将值绑定
使用state machine 和 slot节点(这里需要slot节点是因为使用动画蒙太奇 时,动画都默认放在DefaultSlot插槽中)
设置通用的状态IdleWalkRun和Dead以及两者的转换规则
使用blend poses节点和sequence player节点 ,并将sequence player的节点expose as pin,再将pin promote to variables
在IdleWalkRun状态中,使用blend space player(默认2d),方法一:将其expose as pin后将资产作为变量导入
方法二:创建子蓝图,在子蓝图变量中设置
在这里测试的时候发现为什么echo站在敌人面前敌人都不搭理她,得跑好一阵敌人才看到她,最后才发现是因为pawsensing的视角范围弄得比较小,echo压根没抛进pawnsensing的检测范围内
226 raptor: creating an raptor enemy type
用当前死亡的动画帧生成资产
针对raptor生成blendspace 1d
基于ABP_Enemy和BP_BaseEnemy生成子蓝图 ,并配置变量
227 raptors attacks: implementing attack behavior for the raptor
将righthandsocket重命名为weaponsocket,以适配多种敌人,毕竟raptor不用右手拿武器(类似于boxhit)
在raptor的头上增加weaponsocket
生成raptorweapon,先不消除weaponmesh网格体,用来测试
在骨骼体上添加动画预览
228 raptor attack montage: creating the montage for raptor attack
创建rootmotion动画:选中root bone,在动画首帧和末尾帧创建key,在中间buff咬人的动画帧移动root后再创建key
烘焙动画作为新资产
So now here's our new animation and if we check enable root motion, the raptor does not move, at least 所以现在这是我们的新动画,如果我们选中 Enable root motion(启用根运动),至少猛禽不会移动
its root bone stays still. 它的根骨骼保持静止。
We can uncheck and see it moving forward and check it and see that it doesn't move forward. 我们可以取消选中并看到它向前移动,然后选中它并看到它没有向前移动。
So we now have a root motion animation for our Raptor. 因此,我们现在有了一个 Raptor 的根运动动画。
但是我这里无论宣布选中,在editor中骨骼都会移动,除非是在游戏运行时会有差异。
注意动画要enable root motion,否则运行中,root motion和motion warping不会起作用
动画通知和paladin的基本设置一致
不同体型的敌人需要不同的索敌半径
这里教师的buff的原本的动画,位置都出现了升高,所以他在原本的动画中又重现加上关键帧。但我实现过程中没出现这种状况,纯粹依靠在BP_Raptor中移动Raptor的z轴位置实现双脚落地
在skeletal mesh中创建physics asset,否则raptor不会受击
注意,敌人过大的胶囊体可能会阻止武器触碰到敌人的physics asset从而影响敌人受到伤害
229 raptor hit react: creating the hit react montage for the raptor
attack radius和acceptance radius调不好的话,就会造成echo攻击raptor一次,raptor只攻击我们一次,不持续攻击。而它的状态一直显示在chasing状态,但又实际上不追逐echo的结果(可以Deraw sphere画圈调试)
如果raptor离echo太近而无法攻击到echo,可以调整warp target distance,让raptor距离远些的时候就开始攻击
230 raptor sound effect: final effects for the raptor
growl的其他音源设置为none 这样它随机才发声