Introduction:
I made it past the previous bug with torches and moved onto creating the first Enemy and some basic AI Pathfinding.
Bug Fixing:
Previously I got stuck on a bug where the BP_Torch component of the player blueprint (attached to the body) didn’t show up when trying to connect to it within the BP_Webs blueprint. I was doing it through casting to the BP_Player blueprint. I have no explanation for this next part, but after restarting Unreal Engine it suddenly works and all of the player components are now showing up correctly. I typically leave Unreal Engine open for days at a time, so may need to restart it more often to avoid weird bugs.
Enemy AI and Pathfinding:
Using Quixel Bridge I chose a character model for the first enemy of the game. I chose someone who kind of reminded me of the Terminator from Terminator 2. Not super close resemblance, but close enough.
I then moved onto creating my very first enemy AI and pathfinding events. Basic AI/Pathfinding is very easy to do in Unreal Engine 5, but I can see how more advanced AI may take some time to think through, but also should be fun to create later on.
First created the Enemy AI character class, added ‘sight’ as it’s primary AI/detection and then used a navMeshBoundary to create the space which allows the Enemy AI to navigate. However I used specific Target Points for the actual pathing, meaning where the AI will try to walk to.
The difference is the navMesh enables an ‘allowable area’ for the Enemy AI/pathfinding to navigate through and the Target Point tells the AI exactly where to go. In Unreal Engine the built-in AI/pathfinding already gives the AI/Pathfinding enough knowledge of how to maneuver around or onto objects, such as moving around a corner of going up or down stairs, etc. So a lot of the nuance is already moved right from the start.
Conclusion:
For fun I also added a rectangle light to one of the dark tunnels just to see what it would look like. I really like the outcome!
Next up will be giving the Enemy something to do besides walking between points, which in this case will be to chase the player when it sees the player.