Fix camera frame

Hello,

I have a problem where the camera while keeping up with the player goes out of the frame. Can anyone help me to fix this? Or give some JS code to help

This is quite urgent as I have a project due

Thanks

I’m not sure how you want to set your background but I have some suggestion that hopefully might help.
You might want to add an action (without condition) to enforce camera boundaries. That way you could set the limit to how far the camera could go.
Also it looks like your background might need to go to a separate layer. Perhaps you were going for parallax scrolling background? I’m not sure if I can explain that properly here but there are some tutorials on that you might want to look into.

You’re going to have to explain the issue better (maybe next time use the thread start template). From the image, it looks like the player is out of frame too. If the camera is following the player, what do you want to happen?

A definitive answer to your problem depends on how you are setting the camera. Can you include a screen shot of the events?

And in case it help, there is a center camera on an object within limits action.

The player is not out of the frame, the background is not fully set. :slight_smile:

Sorry, I don’t understand how that comment about the background fits in with the problem.

Have you followed the link and used the center camera within limits action?

here is a better img