UE4 范围伤害RadiusDamage及碰撞检测通道ECollisionChanel

UE4的RadiusDamage函数在进行范围伤害计算时,首先通过物理检测获取所有非WorldStatic的Component,然后在特定的碰撞通道上进行射线检测。若某个Component的碰撞类型匹配特定过滤条件,例如ECC_GameTraceChannel3,则该Component不会受到伤害。这种方法可以避免特定Component接收伤害,而其他Component不受范围内物体阻挡的影响。注意ECC_EngineTraceChannel1与ECC_GameTraceChannel1的区别。
摘要由CSDN通过智能技术生成

UE4的范围伤害函数为

/** Hurt locally authoritative actors within the radius. Will only hit components that block the Visibility channel.
...
 * @param DamagePreventionChannel - Damage will not be applied to victim if there is something between the origin and the victim which blocks traces on this channel
 ...
 */
UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Game|Damage", meta=(WorldContext="WorldContextObject", AutoCreateRefTerm="IgnoreActors"))
static bool ApplyRadialDamageWithFalloff(const UObject* WorldContextObject, float BaseDamage, float MinimumDamage, const FVector& Origin, float DamageInnerRadius, float DamageOuterRadius, float DamageFalloff, TSubclassOf<class UDamageType> DamageTypeClass, const TArray<AActor*>& IgnoreActors, AActor* DamageCauser = NULL, AController* InstigatedByController = NULL, ECollisionChannel DamagePreventionChannel = ECC_
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值