I’m not sure which lecture you’re on (it’s hard to tell from the tag alone), but Kismet is basically the precursor to Blueprints; it was the visual scripting system in the Unreal Development Kit (UDK) that shipped with UE3.
Code looks fine but again I can’t say for sure without looking at the lecture itself.
Yeah the categories are only really helpful when following the course and seeing the topics at the lesson itself.
It’s the " Applying Damage" lesson where we end up using UGameplayStatics::ApplyDamage. I like the ApplyDamage way, I also like the DamageType system. I’m just curious about it since I come from unity, where any sort of gameplay logic is not part of the engine itself. Now all of a sudden I’m dealing with damage systems and projectile movement components that are awesome, but also make me wonder if it’s what should be used.
It probably is. I started my unity journey on gamedev.tv as well and I like the quality of the lessons. It just feels like I’m using some old library that I shouldn’t be touching.
My base-mode when learning is doubt and so I ask a lot of questions.
[A bit late to the party, but for other future readers…]
Regarding that code:
UHealthComponent* OtherHealth = Other->FindComponentByClass<UHealthComponent>();
if (OtherHealth) OtherHealth->TakeDamage(20);
This was implemented in the projectile’s OnHit right? The problem with it that you’re making a lot of assumption about what happens and how:
it assumes the damaged actor implements its health based on UHealthComponent.
Potentially, some actors could choose to handle the damage directly, because they would need to first redirect it to some armor/energy shield components, that need to be depleted before the health could be affected.
it assumes that the only effect of the damage is on the health or that all the other effects are applied by that HealthComponent.
Maybe some other components are used to show some visual effects each time damage is taken (e.g. make the actor blink red for a short time), or maybe to trigger a short invincibility period.
it assumes that there is only one HealthComponent. Maybe the actor needs localized damages and have one HeathComponent for each damageable area (turret, base, …).
it assumes that only the damaged actor/component is interested. Maybe there is a “PawnManager” somewhere that monitors all the pawns and wants to do/show something when they take damage.
Now, there is such a thing as “over-engineering”. One needs to choose the right balance between “generic-but-usually-complicated” and “simple-but-specific/limited”. In this case though, the ApplyDamage/OnTakeAnyDamage is easy to use and all the complications are managed by Epic, so it’s very likely to be better than something like your FindComponentByClass/TakeDamage.