[Solved] Camera not following player despite the camera on the same layer

So I know that for a camera to follow the player, both the player and camera must be on the same layer. Before this there weren’t any errors, but not there are. I think it’s mostly because I made it so that the player would control three characters. I’m trying to do something like this: Totally Spies: Booby-Trap Fortress | Disney--Games.com

Is there any way I could fix this? Thank you in advance! :smiley:

What is it doing? And can you provide some event screen snips?

I completely forgot the screenshots haha sorry

Ok, but where is the bit that follows the current character? You’ve set the camera when the character is switched, but haven’t included the bit where the camera follows the character as it moves.

Oh…how do I do that exactly? :sweat_smile:

Pretty much the same way you’ve done the other 2 times - have a condition that checks the value of the variable user_active, and sets the camera position on the correct character.

If you’re not familiar with group objects I would really look into them. If your characters were in a group object most of your events could be done with one set of events instead of 3. It’s easier to write, read and maintain. It would also make it easier to upgrade to an infinite number of characters.


Groups are just a reference. They’re a bit like how instance behave. You start with many and either apply an action to all of them or use condition(s) to narrow it down to a fewer or just one. You can then set or get any property or variable as if you had used the objects name.

I considered that too, and it’d be the best approach. However, it requires a bit of change that is best served with metadata on each sprite object because of the specific settings on all player objects depending on which one is selected. I thought that could be getting a bit too far off topic.

The metadata would have to cover things like the specific colour for each sprite and whether the sprite has camera focus.

1 Like

I know it’s a balancing act. You don’t want to overwhelm anyone.

1 Like

Hey! I followed your guy’s suggestions and they worked. Thanks!

Can you screen snip the events so anyone else who comes across this thread can see your solution?

Did I do it right?

Looks like it. Thanks for sharing.