Help with sidescroller camera blueprint

So recently I’ve been trying to implement the camera blueprint shown in tutorial [[Link][1]] into my own game but I’ve run into some problems.

My problems started with the fact that camera blueprint made with the 2D sidescroller in mind, whereas I’ve been going with the 3D sidescroller instead. The problem with is that the axes differ from one another with the player character by default moving left to right on the Y axis in the 3D sidescroller template, as opposed to the 2D sidescroller where the player character instead moves along the X axis when moving left to right. Because of difference, following the tutorial linked above exactly to the letter would result in the camera completely facing in the wrong direction, I managed to slightly address the issue by changing all the references within the blueprint to the X axis to the Y axis. The end result was that the camera was now aligned with my level layout but facing backwards, an improvement over the situation before, but not by much.

The first picture below shows the misaligned camera, while the second one shows the original view with the default camera:

The issue is that the camera is facing in the wrong direction along the X axis but I can’t seem to get it to face in the opposite direction. Does anyone know how I can reverse the camera so that it faces in the opposite direction?

The other major issue that I’m having is that I can’t attach the camera to my player character because the blueprint setup requires the camera to be assigned to an actor within the scene, and when I start up the game instead of possessing the character I place into the scene, the game spawns another version of my character and that character is the one that gets possessed. The result is that the camera doesn’t follow my player character, instead remaining completely immobile focused on the unpossessed character. I have no idea why happens and I’m not sure whether or not I did myself, I recall having some sort of spawning problem upon the starting the game, way back when I first started working on version of the game, so maybe I did it as some sort of fix?

In theory, problem could be fixed by preventing the game from automatically spawning a character but I’m not entirely sure that I want to. You see, I’m planning on my game having multiple playable characters and I want the character that the player beat a level with to be the character that the player is then controlling when they enter the next level rather than starting every level with the same character.

Instead I was wondering if its possible to change the scripting of the blueprint so that the camera could, I dunno, possess the character being controlled the Player Controller blueprint I have after they’ve spawned unto the map? Or maybe have the camera follow the Player Controller? I don’t have enough expertise in area to know what the best way to attach the camera to my player character is.

Any input into matter would be greatly appreciated!

Constructive Script:

Event Graph:

New Y (formerly X) Value:

New Z Value:

There is no Spring Arm to rotate, I’m not sure if you watched the tutorial I linked or not but camera system establishes a “dead zone” which prevents the camera from following the player all the time when they jump which is exactly what I want. Attaching the camera to a Spring Arm would defeat the entire purpose of blueprint and I may as well use the default camera, which I am absolutely unwilling to do as the default camera is simply awful for making a traditional style platformer.

I’m also not quite sure what you mean by spawn more players, for reference I was going for something like Donkey Kong 64 or Mystical Ninja Starring Goemon where the player can freely switch from one character to another on the fly. I’m just not sure how spawning more players helps with my desire that the character the player is currently playing as doesn’t automatically get swapped out for a preset character at the start of a new level. is why I would prefer some alternative method of assigning the camera to the player character/controller, yes, it’s more difficult way but I don’t learn anything or grow as a game designer by taking the easy route all the time.

Well, first of all, why can’t you just rotate the Spring Arm if the camera in the wrong rotation? Second about the character spawn remove any player start actors you have on the level and do auto posses on your character, that should fix . And if in the future you need to spawn more players to play the game just do it manually. Good luck.

I see, saw the Spring arm at the start of the tutorial though that it’s that, basically you have built your level the wrong direction you need to invert the X offset(make it negative) and that should fix your problem because the camera rotates at the end of your code by itself.

You have your main character already spawned and another one gets spawned because you don’t auto posses your main character, you look at problem and thinking its a feature and it’s not. Just fix the problem and if you need another character in the future just add it to the level manually or through the blueprint. Good luck.

I don’t want to have to possess a character placed within the scene every time the game transitions to a new level because of the nature of the game I’m making. Like I said before, the reason I don’t want the game having to possess a character is placed within the scene is because my game is similiar to games like Donkey Kong 64, Mystical Starring Goemon, or Julius Mode in Castlevania: Dawn of Sorrow in that the player can freely swap between multiple different characters in a level, each with their unique abilities so that they can get past obstacles, solve puzzles, etc. that only a specific character can handle. Having the game automatically default back to the initial character every time you enter into a different area would be really annoying for players and I feel would be just bad gameplay design. I’ve read countless accounts of people getting aggravated with games where the game will automatically swap out the player’s currently equipped weapon with another one, usually the default weapon for cut-scene purposes.

It’s a moot point anyway as I can’t figure out how to possess the player character placed within the scene. I did a comparison between my project and the dead zone camera example project I downloaded, checking the project settings & the possession options in both the respective player character blueprints and I couldn’t find any differences at all, which doesn’t seem make any sense to me at all.

I finally managed to fix the backwards camera, although not in the most ideal manner possible.

I eventually found a way to rotate the camera within the camera’s blueprint but doing so would completely mess up the camera’s functionality and it wouldn’t work properly.

So rather than trying to rotate the camera to face the scene, I decided to rotate the scene to face the camera. It was very tedious having rotate and re-align every object within the level, especially since I went overboard with decorating it when it was simply intended to be a test level. However, the tedium was much more preferable to the frustration of trying to figure out a way of rotating the camera, and as a result of said tedium now the camera is facing the proper direction.

Unfortunately though, I still have the problem of getting the camera to follow my player character. For whatever reason, my project simply will not allow the Player Controller to possess a character placed within the scene and will only possess a character that is automatically spawned in by the game. I checked the project settings & the various possession options of my character blueprint and there doesn’t appear to be any differences whatsoever between my project & other projects with the default settings.

Because of , the only option seems to be changing the camera blueprint to somehow assign itself to the character currently being possessed by the Player Controller. I don’t have enough confidence in my own abilities to make these changes and I’m afraid I’ll just end up breaking things. So if anyone has any ideas on how to make possible then please lend me some aid, alternatively, if anyone has any alternative ideas that would be better then I’m open to that as well.

First of all, your camera system built for a level actor so you will need to fix that, and you will need to add another spawning system for your characters as you explained before. Spawning the default one a the beginning and if they change their character save it and take it to the next I guess you can do it through changing the Default Pawn Class in your GameMode but I am pretty sure its useless because GameMode resets after opening a level, so only if you save your variable in GameInstance and create the system there.

Ps: here the auto posses

-_- Sigh Have you tried to inverted the X offset as I said before? and read my comment above…

Well that’s annoying, I didn’t know it had to be set within the World Settings. I tried turning Auto Possess on within the blueprint and it didn’t do anything, so I assumed that something was wrong.

As for the camera blueprint, yeah I know that the camera system required a actor within the level to be assigned to it. I was hoping that someone would know if it was possible to change it so that the pawn currently being controlled by the Player Controller blueprint would be automatically assigned to the camera rather than having to manually assign an actor within the level to it.

I didn’t know how to invert the X Offset, I tried playing around with Offset numbers in the camera’s settings but it only affected the distance of the camera from the player but not the camera’s rotation. The only way I found to rotate the camera was changing the rotation on the Set Actor Rotation event within the Construction script but as I said before, it completely messed up the camera’s functionality.

I mean rotating everything else to face the camera appears to work, the only downside I’ve noticed so far is that characters I bring onto the scene are facing the wrong direction, but that problem is easily remedied by simply rotating them to face in the right direction, which does not result in any noticeable effects on their behavior. Also before I reenabled Auto-Possess, when game was started it would automatically spawn the player character facing in the right direction with no ill effects.

Invert is when you multiply by (-1) if your X offset was 1000 you just change it to -1000 that should have fixed your problem, but well now it doesn’t matter. Good luck on your project though.

If you mean input -1000 into the X Offset value in the camera settings then yeah I tried that. Unfortunately, it didn’t seem to work so I tried something else.

Then you had to invert Camera Y then, your code looks different than from the tutorial

That’s what I did, I switched the X & Y values around in order to get the camera to be on the right axis in the relation to the player character’s position and then tried manipulating the now Y offset value to see if I could rotate the camera which I could not.

Again you needed to invert or X Offset or Camera Y with one I don’t know(maybe even both), because that what changes the position of the camera.

I’m not sure how you do that unless you’re referring to changing the roll & pitch of the Set Actor Rotation, which I tried and ended badly. Otherwise I don’t know how to invert the Camera Y variable or the X Offset, as I said before changing the X Offset value on the World Outliner didn’t help.

I have nothing more to say, changing the roll and pitch of the Set Actor Rotation should do nothing in your code because your camera rotation follows your character and your camera have no pivot, so whats defines the rotation of your camera is purely its location.

Unfortunately, it does look like I need change the scripting of the blueprint as I feared.

I just implemented a respawning system as I mentioned here [[Link][1]] and upon my character respawning the camera is completely screwed up. The camera seems to be placed inside of character as I can see bits of my character’s mesh when they perform certain actions like swinging their weapon or crouching.

Even before I managed to get the respawning system working I was getting numerous error messages when my character was destroyed after I got the camera blueprint working.

The crux of the problem seems to be that the camera blueprint has no recourse for when the character that it is assigned is destroyed as the character is the only thing that is anchoring the camera blueprint to everything else.

is why I feel like the scripting of the camera blueprint needs to be altered so that the camera is assigned to the player character via the Player Controller blueprint rather than having to be manually assigned, that way when the player character is destroyed the Player Controller can as act as a permanent anchor for the camera so that it can then be reassigned to another character.

So just I tried getting rid of the Construction Script by moving all of the scripting within to the Event Graph and connecting it to the Set View Target with Blend event and changing all the references to the Actor to Follow variable to the Get Player Character event instead within the New Z & Y Values functions as well as the Event Graph.

Event Graph:

New Y Value:

New Z Value:

The end result of these changes though unfortunately didn’t really change anything, it didn’t make the situation any worse than its current state but the main problem at hand still remains unchanged. The only difference I’ve noticed is that the number of errors that in the Message Log has gone from almost 14,000 errors to only 2 remaining.

Unfortunately, these two remaining error messages haven’t helped me at all with trying to figure out what’s going on with the camera. Strangely, the error for some reason refers to the Goonie blueprint, which is the test enemy that I have setup on my test level. I’m not sure what the Goonie test enemy has to do with the camera problem, unless the error message is simply saying that the problem is being caused by destruction of the player character actor via interaction with the Goonie blueprint and the not the Goonie blueprint itself.

Can anyone please help me out? All of camera blueprint stuff seems to be way over my head and I’m not sure as to what I should now.