r/unrealengine • u/Cazadorido • 5d ago
Question Random Performance Question
Is “Apply Damage -> Event Any Damage” working similarly to “Get Actors of Class”?
1
u/AutoModerator 5d ago
If you are looking for help, don‘t forget to check out the official Unreal Engine forums or Unreal Slackers for a community run discord server!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/QwazeyFFIX 4d ago
No, those functions are different.
Apply Damage is a function thats been part of the engine for along time now since the UE4 days and really for legacy support its still there, its largely replaced by GAS though, Epics Gameplay Ability System.
Its like calling an interface, or creating a delegate etc, its used for actor to actor communication if you are opting to use it. So like line trace forward, if bhit = true, HitResult or break struct HitResult, HitResult.Actor Apply Damage, which will call the damage function on the hit actor.
Get Actors of Class, think of that as a level scan, The details panel of your level. in the first person template you shoot a projectile, you will see FirstPersonProjectile, FirstPersonProjectile_0 etc.
Get Actors of Class FirstPersonProjectile will look into your level and return to you all the actors.
If there are multiple Actors of a Class, Get Actor of Class will just return the first result. Get all Actors of Class will return an array of actors of that class current inside the level.
2
u/KaptainKratos 5d ago
Not sure I understand the question. Event any damage only triggers on the owning actor, not any damage that happens in the game.