Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Combat Enemy

Robert Dionian

1/14/2024

Problems: After implementing the delayed loop to move the enemy in c++, the enemies continued to constantly randomly move. This was happening because there was a mixture of BP variables and c++ variables, therefore the right variable to stop the enemies movement was not being modified. Another problem I was having was when converting the attack function to c++ the enemies attack animation was not playing. This is happening because the bool that is set to trigger the animation is not being modified, there is no c++ class for the animation yet so I was trying to pass the bool in as a parameter to the c++ function. Apparently you can not modify BP variables by passing them to a c++ function.

Solution: Because there was a mixture of c++ and BP variables being used it took me some time to pinpoint exactly what was causing the enemies to keep moving. In order to find which variables were causing the issue I started replacing one variable at a time with a c++ version and test each one. I narrowed it down to a bool this way, I forgot to replace a bool that was being referenced in another class. After swapping them all out with the c++ variables everything worked as intended. My problem with the animation not playing has not been solved yet, but I am going to create a c++ class to create my variables I need for the animation, Trying to pass in the BP variable to modify in code was just temporary to see if the rest of the function I converted worked properly.

Support this post

Did you like this post? Tell us