Craig the Cutter Chop Attack Issue - Myles


PROBLEM:

While making Craig's first phase chop attack, I ran into an issue where the attack would always kill the player even if he misses. The attack would start by creating a rectangle indicating where the attack would land. Then, after a short delay, it would kill the player if he was inside. I had experimented with the delay to see if the issue was when the attack would get all the actors colliding with it; however this did not seem to be the issue. Changing the size of the attack also didn't change the outcome. After tinkering with it for a good bit I realized what the issue was.

SOLUTION:

After about half and hour staring at the blueprint trying to find the solution it dawned on me what it might be. For the attack I would pass in a reference to the player characters position into the indicator and final attack. At first what I thought this was doing was just using the same position; however, it turned out that the reference was constantly updating as I moved. This made it so the hitbox would always spawn right on top of the player killing him instantly no matter what. I fixed this issue by saving the target players transform into a variable first, then I would use said variable in the functions I had made. This made it so the hit indicator would share the same position correctly with the actual hit. So after starting at the blueprint for about 45 minutes, the issue had been staring me in the face from the beginning, and now the attack works like intended.

Leave a comment

Log in with itch.io to leave a comment.