Simple Shooter - Overriding Take Damage

Hello All,

Just a note, it might be time to put a spot in the video like, “Sam from the future” telling us that the code needs to changed to work correctly. I was never getting the code to drop down into the logic of the function to get a log message - don’t know why - that was until I read through all the messages on the topic where Dan had the answer, changing it to:

HitActor->TakeDamage(damageDealt, DamageEvent, ownerController, this);

It would help people realize that what they had done is not wrong, looking through code for donkeys trying to figure out what had gone wrong and commenting in/out code, and then about to write a message saying “what the” or checking through the other messages, only to find out that the actual vid was the culprit.

Rant over!

What part of the video needs changing? Skimming through the video I’m not seeing TakeDamage being called at all (presumably done in the previous lecture).

The code that needs changing is indeed from a previous lecture, but, at that point in time the code works fine. It is in ‘this’ lecture where the UE_LOG is introduced that the code will NOT run at all correctly @ 7:41, it will never print the log message. A change now has to be introduced to the previous code to run correctly. The code could be changed earlier but this would be the easiest place to put a message from the future, which would stop a lot of hair pulling.

Hi Vaughan. I finished this course just 3 weeks ago I think and I had no issues with the code in question. I completed the course with 4.27.2 as well so it’s not something new in the course.

I wasn’t the only one who had trouble with the code in fact it was Dan who came up with the solution :worried:. The way I figured since I was the only one using 4.27.2, it was going to come up more often as a problem in the future!?!

In any case, I really have to say thankyou for helping me with coming up with a solution for my Unreal problems and giving me a recommendations for a new computer system - everything is working a real treat now. Things that took 10 minutes to compile, now only take mere seconds, so, I can now get through multiple lectures in a single day instead of taking multiple days to get through a single lecture :sunglasses:.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms