How do I lock the camera?

Hello,

I am making a Side Scroller game using the template and the default character, I have put some BP so the pawn moves in a direction at all times and if the player presses the letter A the direction changed from right to left. When this happens the camera is also rotating which I do not want.

I need the camera to follow the player but when the player changed direction I do not want the camera to do the same.

Any ideas how to fix this?

Thanks.

Could you show what you have taking place when you trigger a direction change?

I don’t see why the camera would be effected if you’re using the SS template.

Maybe try changing from reversing the Input feed to feeding in 1 either way…
But reversing the direction normal.

0, -1, 0 one way
0, 1, 0 the other


Using the keys you are using… it would be like this.
(this may not fix the problem)

120320-revisionsa_d.jpg

Hi, could you explain a little more what you mean as I am new to ue4 and development in general, I understand the world direction is the issue here but unsure how to fix it :slight_smile:

I have tried the other method with having the world direction changing but not the scale value as shown in the previous screenshot but the camera still flips when I change direction :frowning:

I want the camera to follow the player at all times which it does, but when I change the direction of the player the camera spins 180 degrees. I just want the camera like every other game in this genre basically :smiley:

I have changed it from relative to world and it now looks like your screenshot but unfortunately the camera still flips 180 degrees when I change the player direction.

I have changed it on the spring arm. and it is set to -90 degrees so the camera is right where I want it. But when I press D and move left instead of right the camera flips :frowning:

Wait… I think I have been misunderstanding.

I thought you were saying the camera reversed when the player does - moving to the other side.

Are you saying you want the camera to continue moving Right when the player goes Left?

Okay, sometimes it is so obvious it is hard to notice…

Click on the Spring Arm and change the Rotation to World(Absolute)

120342-absrot.jpg

I’ll keep digging… changing the arm to Relative was how I got it to start turning the camera with the character.

I’ll see if I can find other things that will do it too.

I took out the Spring Arm and it started swinging 180degrees with the character changing directions.

After I replaced the Arm’s settings with this it worked again.

120343-armsettings.jpg

I have just started a brand new project and for some odd reason my camera is working fine. Even though I have the exact same BP setup. So if you have any further things just in case it breaks in the future then I would still appreciate some help.

But for the moment it is working, the only difference is the spring arm and camera I placed manually but in the new project I have not touched them, the settings were the same though so I am still unsure how one works but not the other.

Thanks for all the help :smiley:

Good luck with the project.

I don’t think I was much help. :wink: