CollisionComponent {{ currentPage ? currentPage.title : "" }}

UltimateCollisionComponent

Purpose: Used for collision detection of weapon, player, and launcher hits

  • Hit trace type(ECollistionType):For example, left hand, right hand, right foot, right hand weapon, tail, etc., and then set specific components and slots in the OnSetupCollectionSocket notification

  • Please add animation notification status in the animation montage when hit ANS_HitBox to OpenHitCollision

Variable

Explain

CollisionHandles(Unpublished)

All collision handles opened

CollisionSavedData(Unpublished)

Collision saves data. When calling OpenHitCollision to enable collision, a copy of data will be saved first, and then the data will be used when calling OnSetupCollisionSocket to set the slot

bCollisionTrace(Unpublished)

Whether to enable collision checking and close it when the collision handle list is empty

bAllowTrace(Unpublished)

Is it allowed to check? The first frame that was initially opened cannot be checked due to only one coordinate, and is used to wait until the second frame to start checking

SocketLocationMaps(Unpublished)

The saved slot coordinates are updated after checking when bCollisionTrace is true

HitDatas(Unpublished)

Hit data, used for Actor hit storage of a single handle to avoid multiple hits

GroupHitDatas(Unpublished)

Group hit data, used for storing group Actor hits to avoid multiple hits

CollistionSockets

Collision slot, call AddCollectionSocket to add

CollisionQueryTypes(Setting)

Check collision type

IgnoredCollisionProfileNames(Setting)

Ignored collision description name

IgnoredClasses(Setting)

Ignored Class

TraceRadius(Setting)

Trace Radius

bEnableTraceDebug(Setting)

Show debug

Function

Explain

CreateHandle(Unpublished)

Create collision handle

CloseHandle(int32 Handle)(Unpublished)

Close collision handle,The corresponding slot and hit data will be removed

GetHandleCounter(Unpublished)

Obtain the number of collision handles

RemoveCollistionSocket(int32 Handle)(Unpublished)

Remove collistion socket

AddCollistionSocket(UPrimitiveComponent* Component,const TArray<FName>& SocketNames)

Add collision slot and call it in the event distributor OnSetupCollisionSocket

OpenHitCollision(ECollistionType CollistionType, FName DamageGroup,float DamageMultiplication, bool bHitFreezeFrame)

Enable hit collision detection, usually called when the animation notification state UANS_HitBox is turned on

CloseHitCollision(int32 Handle,FName DamageGroup)

Turning off hit collision detection is usually called when the animation notification state UANS_HitBox ends

CloseAllHitCollision

Close all collision handles, call on death, called on APrimalCharacter:: OnDeath

GetIsIgnoreClass(UClass* ActorClass)

Is Ignore Class

GetUniqueSocketName(UPrimitiveComponent* Component, FName SocketName)

Obtain a unique slot name to identify the stored slot coordinates

GetHitActors(int32 Handle, FName DamageGroup)

Obtain a list of entities that have been hit

CreateGroupHitData(FName DamageGroup)(Unpublished)

Create group hit data

RemoveGroupHitData(FName DamageGroup)(Unpublished)

Remove group hit data

AddHitData(int32 Handle, FName DamageGroup, AActor* HitActor)(Unpublished)

Add hit data, called by TraceHit after hit

RemoveHitData(int32 Handle,FName DamageGroup)(Unpublished)

Remove hit data

TraceHit(Unpublished)

Collision hit check

UpdateSocket(FCollistionSocket CollistionSocket)

Update individual slot positions

UpdateAllSocket

Update all slot positions

Event Distributor

Explain

OnHit(FHitResult HitResult,float DamageMultiplication, bool FreezeFrame)

Hit event, where damage, effects, etc. are achieved

OnSetupCollistionSocket(int32 Handle, ECollistionType CollistionType,bool bHitFreezeFrame)

Set collision slot event, called when hit collision detection is enabled, where AddCollectionSocket is called to set collision slots

  • ANS_HitBox:Enable hit collision detection

Variable

Explain

CollistionHandle(Unpublished)

Collistion Handle

CollistionType

Collision type, and then call AddCollisionSocket in OnSetupCollisionSocket to set collision slot

bHitFreezeFrame

Whether to enable card frames and perform card frames after hit. The card frame effect needs to be implemented in OnHit by oneself

DamageGroup

Damage grouping is used for several hit collision detection notices to use the same hit data to avoid multi segment damage to players, in which Reference counting is set

If the hit collision detection notification is not continuous, a hit collision notification with DamageMultiplication of 0 needs to be added for reference (it will not be checked, but will allow the hit data to continue to exist). When the reference is 0, the corresponding group hit data will be removed

DamageMultiplication

Damage multiplier, which is similar to adjusting multiple damage segments of the same montage. For example, if the initial blade speed is slow, it only deals 0.7 times the damage

{{{ content }}}