Not keeping data when switching between levels

i have a smooth camera but it disconnects from the player, i have a extractor with “other X” but it keeps deleting it as if i never put in “player” and the object number

The reason for this is because the Extractor is set to “Other”. That other is Player, but you also need to select a specific object, so when you move to a new level it’s not there. To fix this just use a global with the player X in it.

can u help please?
go to land 1 camera, theres the code

I way to fix this is to edit the player behaviors and extract the players x and send it to the camera using a message. Then you just use a mailbox with whatever name you used for the message and plug it in as if it were the other x extractor.

it wouldnt work cuz it needs the number not JUST a input

What you want to do is this inside the player

Extractor (X) → Global [Player X]

inside the camera you will replace the Extractor set to with with the Global [Player X]
It’s better habit to use globals for these types of values over messages.

yes it would i also forgot to mention that you have to hook it up to a number in the set input then connect that

For what you’re saying Number is unneeded because the mailbox should always output because you should always be extracting the players X position

1 Like

Then it should work, I use it for my game’s movement and it works

Btw the “player x” and “player y” globals are not being set, you’ll need to do that.

what does that mean
kvr4fj5uiny32ufheyufy hreuy

You should have globals for the players X and Y.

In the Camera object, you should be using the Player X instead of the Extractor (set to “Other”)

i did but its still broken

i tried all inputs and it didnt work

You need to set the global in the player

image

1 Like

yeah i did this exact same thing with messages

@KiwiLeaf_Entertainment, it is technically the same but you have more benefits using globals because any object grab those values. Cameras, enemies, items, etc.

Like having enemies chase you, homing missiles, shooting at the player, moving a camera around, semisolid platforms, and much more.

2 Likes

Using globals is better than messages for values like X and Y because like JR said they can be used in more situations without having to add on more code.