Camera doesn't follow player in duplicated rooms

A

achmoye

Guest
Hey guys,

I'm stuck at this problem :
I'm doing a Roguelike and I want the player to go randomly through some pre-generated maps.

I got one map ready (just a straight path from left to right) so when player hits the right end of the path I make him spawn in the next room where the blue circle is (spawn position)
As the room is duplicated I expect it to behave the same and keep follow the player with camera but it doesn't.
Also, the Player object is persistent, and rooms too.

Do I need to update the camera in new rooms somehow ?
Following camera works like a charm...until I try to duplicate the room !

The viewport I use :
Camera : 1024*768
Viewport : Same as camera
Object following : obj_player
Borders : same as camera
Horizontal, vertical speed : -1 (follow player)
 

Attachments

A

achmoye

Guest
Update : I know have a persistent camera object for all rooms. I got rid of room viewports and variables, i've been told it's simpler that way.
It now allows views automatically when entering new rooms.
It still does'nt work though :/

Camera goes top left as soon as I enter the room, and doesn't follow the player.
 
Top