Download

Help with Sidescroller camera

Hi!

I’m having a small problem with the SideScroller camera, I made a Sway/Lag system for the camera and displaced it a little to a side to make a better view of the field. so I’m having a great problem, when I’m close to a Wall, the wall don’t let the player see anything.

So, I want to move again to another side to have again a better view of the field like I show in the attached draw. if you need some help to know my blueprint,this is it.

Creating the Cam

Updating the Camera position in the game

Anyone can help me with this problem?

Note: The second “camera” is just for save a position for the camera if the character changes the direction of movement. one for Left movement and another for Right movement

Hey NightmareSystem!

The Spring arm component actually has a camera lag option (if you dont need it to be a custom setup) so this might help clean things up for you.

As for your question, there can be a number of ways to go about this. You could use a trace from the camera to the player to see if there is anything obstructing the view. If there is something in the way then you can interp to center the player on the screen. Another would be to again use the spring arm to check for this itself using the camera collision options.

Hope this helps!

Hi!

Thanks for answer ^^. I finally used the “trace” option, but not from the Camera, instead I used a trace from the player, I already have a function to detect if i’m touching a wall for make my character wall grab and wall jumps , so I used that function to make the game if i’m tounching the wall, if my character is doing it i change the position of the Camera to one with a centered look to the character :). thanks to the clue ^^