Camera angles?

K

KarateMan

Guest
Hey!
So in my current project I'm working on Ibe got it so when you press a button you can change the direction of gravity 90 degrees. I want to be able to rotate the camera with it, I've been trying to get the camera angle to change but for some reason nothing changes.
I have a camera object
Create event:
View_camera[0] = camera_create_view(0,0,1024,768,0,noone,-1,-1,-1,-1);
If !view_enabled {
View_visible[0] = true;
View_enabled = true;
}

And then in my gravity changing script:

If grav_right = 1 && global.grav =0{
Global.grav=1;
Camera_set_view_angle(view_camera[0],90);
Exit;
}

The gravity changing is working, but the camera doesn't seem to be showing properly. If I set the cameras starting angle to 90, nothing changes. But if I put a debug message to return the camera angle it does come back 90 but I'm not seeing any change.

Any help would be awesome!
 

angelwire

Member
Put this in the step event to see if the camera has been set up properly:
camera_set_view_pos(view_camera[0],random(5),random(5));
If the camera is shaking then it has been set up properly and we know to look for a problem somewhere else.
 
K

KarateMan

Guest
Put this in the step event to see if the camera has been set up properly:
camera_set_view_pos(view_camera[0],random(5),random(5));
If the camera is shaking then it has been set up properly and we know to look for a problem somewhere else.
So I just tried this and nothing is shaking. Is it because my camera is the size of the room?
 

angelwire

Member
It most likely means that something is missing when you set up the camera.
Try removing the if !view_enabled so your create event looks like this:
Code:
view_camera[0] = camera_create_view(0,0,1024,768,0,noone,-1,-1,-1,-1);
view_visible[0] = true;
view_enabled = true;
 
K

KarateMan

Guest
It most likely means that something is missing when you set up the camera.
Try removing the if !view_enabled so your create event looks like this:
Code:
view_camera[0] = camera_create_view(0,0,1024,768,0,noone,-1,-1,-1,-1);
view_visible[0] = true;
view_enabled = true;
I tried this and still nothing happens...
The screen doesnt shake and the angle does not change when I change the gravity. Is there something Im missing other than Camera_create_view?
 

angelwire

Member
Are you using any other views or cameras in your game at all? Maybe a different view is being drawn on top of view 0?
 

angelwire

Member
Add these 7 lines underneath view_visible[0] in the create event:
view_visible[1] = false;
view_visible[2] = false;
view_visible[3] = false;
view_visible[4] = false;
view_visible[5] = false;
view_visible[6] = false;
view_visible[7] = false;
 
K

KarateMan

Guest
Add these 7 lines underneath view_visible[0] in the create event:
view_visible[1] = false;
view_visible[2] = false;
view_visible[3] = false;
view_visible[4] = false;
view_visible[5] = false;
view_visible[6] = false;
view_visible[7] = false;
This worked! thanks so much!
 
Top