"Headaches with Advanced Side Scroller Cameras"
Author: Jonathan Rivero
Posted on 9/13/2024
Hello! I was tasked with Implementing an Enhanced 2.5D Camera System in the Style of those traditional 2.5D Side Scrollers with a bit more fluid motion rather than a stale. I first wanted to start up with a Follow Camera that has the option to lead the Player Forward or not. For implementation, I read the Source code from a Plugin by NBT Games of their 2D Side Scroller Template as inspiration for my Implementation, But What I found very confusing was when I applied the Follow Camera Component to the Player by creating the sub default Object, the Details Panel doesn't show any data values.
I tried to break down this issue by first checking if I exposed it to the blueprint by using the "UPROPERTY" Macro and adding in a "AllowPrivateAccess" specifier which if marked true will defined in the C++ private scope will make things accessible to blueprints when applied. However, even with that after exchanging out the old Camera Component for the new one and relaunching the Editor, it still didn't show up. I then tried making it a "BlueprintSpawnableComponent" and after realizing I forgot to fill in the Values The Follow Camera started to behave as it should by leading the view the way for the Player, however, when the Player turns, so does the Camera, I then checked back wit the original Source Code by NBT and saw that every frame he is always setting the world rotation to a certain value that overwrites the World Rotation of the Camera and fixed the issue.
But then all of a Sudden, I went to set everything back to the way it was after many Debugs and re-coding The Details Panels was is now populated with the "Follow Camera" Properties that finally exposes the Component to the Blueprint, however I don't understand why this fixed it if Putting the Camera Component to have a "UPROPERTY" having the required Specifier. However, Just when I thought it was over, My Teammates started to get the same issue. We decided to ask our Instructor about this and going over and debugging it, we found out is a little mishap on Unreal's Part. The Fix for this issue if any of you came across this is to either reparent your Blueprint to another Class and reparent it back to your Original Class that you made in C++ or simply re create the Blueprint from Scratch and your it will show in the Details Panel. I Hope this helps to those who have Came Across these issues and see you on the Next Blog!
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.