• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help with layer_sequence_create

I'm using layer_sequence_create to create a transition from one room to the next
the code is
--------------------------------------------------------------------
function TransitionPlaceSequence(_type)
{
if (layer_exists("transition")) layer_destroy("transition")
var _lay = layer_create(-9999,"transition")

layer_sequence_create(_lay,0,0,_type);
}
--------------------------------------------------------------------
This code worked find until I added a camera. I figured out that when I set my camera (view_camera[0] = camera), the layer_sequence_create no longer works. It's only when I remove the view_camera[0] that the sequence works again.

The camera code looks like
--------------------------------------------------------------------
camera = camera_create();

var vm = matrix_build_lookat(x,y,-10,x,y,0,0,1,0);
var pm = matrix_build_projection_ortho(1920,1080, 1, 10000);

camera_set_view_mat(camera,vm);
camera_set_proj_mat(camera, pm);

view_camera[0] = camera;
--------------------------------------------------------------------
I have no idea why view_camera[0] = camera would break layer_sequence_create. Does anyone know how to fix this?
 

Gizmo199

Member
Did you try just using camera_apply instead?

Edit: yeah I have no clue why. The camera is being placed at your x/y position. What position is the sequence being created + also where is the sequence origin point?
 
Thanks so much for responding!
The sequence origin point is at 0,0
and the position the sequence being create is 0,0 (although eventually I plan on it being set based on the x coordinates of the camera)
 
Top