[SOLVED]Player moves only if i don't have camera centered to it

I’d like to make the camera always center on the player but it doesn’t want to move here are all of the event’s:

Are you sure the Player doesn’t move? It’s because, with the events you provided, it looks like Player moves no matter the camera is centring it or not. Make sure you have any other object in the scene to check if the Player is moving.

1 Like

To add to what @Mixen wrote, make sure the other objects are on either the base or Sprites layer, otherwise they won’t move either (because the camera isn’t moving for any other layers).

I am sure that the player moves i have checked with a map as the base layer, and @Mixen the player only moves 90 degrees when A key is pressed (letter a)

90 degrees is straight down. Is that what you mean? Because you’re adding a force at 180 degrees, which is to the left.

Yeah i meant 180 degrees

So do you still have a problem, or has it been solved? I sounds like it all works as the events suggest it should.

Still not solved and i agree that it should work

So what is the problem? You said you’re sure the player moves and that the player moves to the left (180 degrees) when the A key is pressed.

And what layer is the player object on?

Welp the player is on layer “sprites” which is on top of everything and it works only when i remove the “Awlays: Center camera on object Player” thing

The way I understand the events, you should be seeing the player object in the middle of the screen, no matter which way you move it. Anything on the sprites and base layer should move in the opposite direction to the key press - if the A key is pressed, all sprite and base layer object should scroll to the right, while the player object stays centred on the screen.

If that’s not the case, can you clearly describe what is happening?

When i press A nothing moves but when i remove the Center camera on player code camera stays put and player moves

When you say nothing moves, what doesn’t move, other than the player?

Like the background doesnt seem to scroll in the back like it moved at the same rate as the player

Which layer is the background on? Can you give a screen snip of the background properties in the editor?

The background image is on the background layer. You’re not scrolling that layer. You’re only scrolling the sprites and base layer. So the background won’t appear to move.

What should i do then?

Either put the background image on the base layer, or add the “Center camera on Player (layer: "Background", camera:)” action to your event that centres the other layer cameras.

Alright i’ll try it out now