Knowledge base
Knowledge base
Knowledge base
Free, anonymous browsing of Unreal Engine Blueprint examples, node references, and best practices. The same content the WoalzCraft plugin uses to generate Blueprints.
25 results for damage
Dealing damage: Event → ApplyDamage(TargetActor, BaseDamage, InstigatorController, DamageCauser, DamageTypeClass). Receiving: EventAnyDamage → Damage output → Subtract_FloatFloat(CurrentHealth, Damage) → FClamp(Result, 0, MaxHealth) → SET CurrentHealth → Branch(CurrentHealth <= 0) → True: DestroyActor. Initialize CurrentHealth=MaxHealth in BeginPlay.
Pattern: EventAnyDamage → Subtract_FloatFloat(A=CurrentHealth, B=Damage) → Clamp(Value=Result, Min=0, Max=MaxHealth) → SetVariable(Health=ClampResult) → Branch(Condition=(Health <= 0)) → True: call OnDeath custom event. Variables needed: Health (float), MaxHealth (float). EventAnyDamage output pin is 'Damage' (float). Clamp inputs: 'Value', 'Min', 'Max'. All floats.
Event AnyDamageUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoUGameplayStatics::ApplyDamage. Triggers EventAnyDamage on target.
Apply DamageUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoPattern: On EventAnyDamage → GetPlayerController(0) → GetPlayerCameraManager → StartCameraShake(DamageShakeClass, MapRangeClamped(Damage, 0, 100, 0.3, 1.0)). Create CameraShakeClass as BP extending UCameraShakeBase with RotOscillation and LocOscillation settings.
Pattern: WBP_DamageNumber widget with TextBlock. On damage dealt: CreateWidget(WBP_DamageNumber) → SetText(Damage amount) → AddToViewport. Tick: ProjectWorldLocationToScreen(DamageLocation + UpOffset) → SetPositionInViewport. Timeline Alpha 0→1 over 1s: SetColorAndOpacity(FadeOut) + move up. OnFinished: RemoveFromParent. Alternative: use WidgetComponent in world space.
Pattern: Attack input → Branch(bCanAttack) → PlayMontage(AttackMontage) → SET bCanAttack=false. AnimNotify during montage: GetActorLocation + GetActorForwardVector*AttackRange → SphereTraceMulti(Loc, Loc+Forward*Range, AttackRadius) → ForEach hit: Branch(HitActor != Self AND not already hit) → ApplyDamage(HitActor, Damage). OnMontageEnded → SET bCanAttack=true.
Apply Radial DamageUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoEventAnyDamageUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoApply Point DamageUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo ago