why is my view window still the same size as my room? My objects are just distorted. I can only see the bit I'm supposed to see through the camera but it's stretched across the viewport which is the size of the room. Yours works fine??
@shadow_dev12592 жыл бұрын
I'm a little bit late here but, how would I go about changing the window size of the camera using code? By window size I mean the size of the camera on my screen, not how much of the room I can see.
@LetsLearnThisTogether2 жыл бұрын
Do you mean viewport, like the window your game runs in and you can move around?
@lordnoda Жыл бұрын
Bit late to this, but yes. How do you set the viewport programatically?
@LetsLearnThisTogether Жыл бұрын
Look for the functions camera_set_ and you’ll find all of them there.
@bradenalexander24773 жыл бұрын
What is the advantage of creating an objCamera rather than using the preexisting ones?
@LetsLearnThisTogether3 жыл бұрын
Many. Split screen, mini maps, custom movement, etc.. Anything beyond having a camera simply follow a player, you’ll want your own.
@davidstaat4120 Жыл бұрын
I'm encountering a weird bug where the player character shakes if the camera moves diagonally. Is there anything that can be done about that?
@LetsLearnThisTogether Жыл бұрын
Probably. Do you know that the player is moving, or does the camera move in a way that makes it look like the player is moving? If it’s the truly the player shaking and moving, there’s something wrong in your diagonal move code. A camera is just a view, it should not affect any objects moving, at least by default. You may have added in more code. If it’s the camera making the player look like they’re shaking, try to smooth out your camera moving a bit more. Maybe check if the camera is close to where it should be and immediately snap it there.
@davidstaat4120 Жыл бұрын
@@LetsLearnThisTogether I'm pretty sure it's the camera shaking. I think the problem that's occurring is that my diagonal move code uses the lengthdir_x and lengthdir_y functions. So it likely returns a decimal number. If the x and y speeds for the camera are set to -1 it's not matching the speed the character goes when moving diagonally. At least that's my guess. Here's my movement code if you want to take a look: key_down = keyboard_check(vk_down); key_up = keyboard_check(vk_up); key_right = keyboard_check(vk_right); key_left = keyboard_check(vk_left); hdir = key_right - key_left; vdir = key_down - key_up; if hdir != 0 or vdir != 0 { dir = point_direction(0,0, hdir, vdir); hsp = lengthdir_x(spd, dir); vsp = lengthdir_y(spd, dir); x += hsp; y += vsp; }
@LetsLearnThisTogether Жыл бұрын
Lengthdir is great, but I think you need a snap in the eventually, otherwise it will ping pong around and never truly reach 0 when moving the camera. Your camera code looks good to me.
@Musicman995 Жыл бұрын
i cant find the viewports/camera thing anywhere, it's just not there
@LetsLearnThisTogether Жыл бұрын
They’ve changed a few things. You may need to open the room, and then make sure you’ve got the room selected in the asset browser. If you don’t see them still, try going to the menu at the top, layout -> reset layout. Then try again.
@deoxys_prime Жыл бұрын
i did everything step by step and it turned my 1920 1080 window in to an ugly square