After changing the default First Person, I lost the ability to move the gun verticle to follow the camera. Apart from this, everything was working but due to this, the aiming was off.
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/22186-using-first-person-camera-to-see-the-player-character
https://wiki.unrealengine.com/Oculus_Rift#True_First_Person_Viewpoint

From the two links provided, I tried to take some advice on the first person camera set-up, especially the hierarchy. After trial and error, I finally found a solution to the problem.
By creating the Head slot as the parent of the camera, it will follow the head. If I made the mesh a child object of the camera, it fixed the problem of looking up and down with the weapon, however, the aiming was very off and the camera always resulted in being too close to the hands, or being able to see the head whilst running - regardless of how much I moved the camera position and rotation.
Instead, I gave up trying to fix it this way, and made the camera a child actor of the mesh, and investigated the "Yaw Rotation".

Eventually, I came across a setting that I tested, and it solved my problem. The weapon now follows the camera on the Y axis and the X axis. The only problem now is the accuracy of the shooting.

Previously I edited the positioning of the crosshair to match the aiming more accurately. I readjusted these settings to match it better. It is not perfect, but it is far more accurate than before. This is a problem to look into later. At this stage, some shots are accurate, whereas others are slightly inaccurate, but still in the correct direction. This is not a major issue right now, and I suspect it is due to a setting requiring adjustment from the default FPS for a deliberate offset to give a sense of realism.
Stairs Bug
I was facing issues with the stairs, the zombies were occasionally getting stuck on the staircase, which appeared to be at certain angles. After I fixed the rotation of the camera, it appeared the player was getting stuck on the stairs sometimes, but others time it was not. I had no idea how these two would be related, but I noticed I was getting stuck on the same step.
This leads me to believe perhaps one of the steps was too high, and I was getting 'caught' on it, and perhaps the zombies were too. The entire staircase was being changed as one, rather than individual steps so I am unsure how I would have ended up with one higher step. Still, I decided to go ahead and make the steps smaller, and create more of them, and make the floor thinner because it acts as the final step.

After completing this and fixing the materials, I tested it out numerous times and my character was no longer getting stuck. The zombies also appear to have no problem getting up the stairs anymore, regardless of the angle!
No comments:
Post a Comment