[Solved] Issue with camera

Having problems with the camera on my platforming game.

I’m very new to developing games and currently trying to make my camera center on my sprite however when I add the action it moves my sprite’s starting point to the center of the screen causing it to clip through objects, then just fall off the screen. All the tutorials I’ve seen show it being done very simply but when I do it it’s not working.

I have tried centring the camera on player.X() but this makes it even worse as well as trying to zoom the camera.

Anyone know what I’m doing wrong? Or how I could fix this.

How it looks when I add the center camera on object action:

Annoyingly I can’t embed the other photos into this post.

Thankyou for any help!

Could you put up a picture of your events. So I can see what you did.

1 Like

From what you’re describing, it sounds like you are centring the player object on the camera, and not the other way round.

It’s like you used this:


when you should use this:

image

1 Like

That was the action I was using however it still isn’t working. Please see photo for reference.

Since I’m a new user I can only embed one photo at a time, this is how it looks now I’ve added the center camera action

And this is how the level is meant to look:

How many player character do you have in the scene? Check by opening the Instance list channel (icon on the top right if the scene editor) and ordering by object name:

image

1 Like

Looks like I had quite a few platforms set as player, I have now set them all to base layer however the problem still persists

What it looks like now:

I just noticed this. It is doing the centring on the player just once. You need to get rid of the 'At the beginning of the scene ’ condition.

1 Like

Ah after making that change the camera now follows the player however it is still causing the player to spawn outside the map on an invisible platform?? Just like the photo above

You’ll need to change the camera position for all the layers of the objects you want moved - the player, background and platform.

1 Like

Finally! Thankyou so much, was driving me a bit insane.