Recently, I’ve been trying overhaul the camera in my game into something much more robust by following tutorial video [[Link][1]]. The end result after it was finished was a huge improvement over the default camera and everything seemed to be going well, that is until I started working on the taking damage & death mechanics for the player character.
Upon death of the player character, the game would destroy the actor and upon exiting the game I would receive a gigantic list of errors (about 13000) in the Message Log. was obviously was a very bad sign but since it didn’t seem to directly impact gameplay I continued onward and decided to implement a way of respawning the player character upon death and its here where my main problem begins.
With the respawn system incorporated, upon the player’s health reaching 0, the actor would be destroyed and respawned at the start of the level as intended. What wasn’t intended though was that for some bizarre reason the camera was no longer in its proper location, instead the camera appeared to be stuck inside of my player character judging by the fact that I could see parts of my character when they would perform certain actions like swinging their weapon or crouching.
It was obvious that the problem lay with the camera blueprint I implemented, due to the error messages not appearing until after I switched to new camera blueprint, as well as the fact everything else except for the camera worked perfectly.
I tried to modifying the blueprint a bit by moving everything within the Construction Script into the Event Graph and attaching the newly moved scripting to the Set View Target with Blend node, while also changing all references within the blueprint to the Actor to Follow variable instead to the Get Player Character node. Overall, the changes to the blueprint didn’t really seem to change anything at all, the only change I noticed was that the number of errors in the Message Log dropped from 13,000 to 2.
For reference, the blanked out area refers to my character blueprint, while Goonie refers to the test enemy I’ve made working out various gameplay mechanics.
I tried looking up what ‘Is Pending Kill’ refers to and apparently it refers to something that has been destroyed that the game engine is still trying to access despite it no longer existing. So I guess that the camera blueprint is still trying to communicate with the destroyed previous actor instead of newly spawned one? Although I’m not sure why results in the camera getting stuck inside my player character upon being respawned.
Since I have no clue on how problem might be fixed, I was hoping that someone else here would be able to help me figure whole mess out.
Thanks in advance!
Event Graph:
New Y* Value:
New Z Value:
*Originally in the tutorial video it was the X value but due to the fact that it was made using the 2D sidescroller template which has everything facomg on a different axis than the 3D sidescroller template which I used to start my game, I had to change to all the references to the X axis to the Y axis and vice-versa.
EDIT #1: I added a link to a project here [[Link][6]] that contains all the blueprints related to the camera. Feel free to download it if you’re willing to take a look at it and see if you can fix the problem with the camera.
EDIT #2: In order to kill the player so that they will respawn, press the ‘Delete’ key. Pressing the key will deal damage to the player and they will die after the key is pressed three times.