This is how I like tutorial videos: quick and to the point. I was struggling with camera zooming but your video is very helpful. Cheers mate!
@paulomtts4 жыл бұрын
I can't stress enough how much I hate those long tutorials filled with babbling and useless comments.
@masterjohn3126 Жыл бұрын
quick and to the point? theres only 2 lines of code anybody actually needs to know in the entire video yet its over 7 minutes
@misterr30834 жыл бұрын
Such an incredible tutorial, so short but packed with an amazing amount of clear and useful information! You are so good at making tutorials. There is an art to clarity and simplicity and you have nailed it! Really really appreciate it.
@puntastic13513 ай бұрын
5 years it's been and this is still a solid tutorial , great job mate
@nyeponpon3 жыл бұрын
I'm really impressed by how fast you go to the video's point. Usually, GMS tutorials in YT are made by someone who do not plan how to do the video in first place, there is no script and they get lost quickly or make useless long comments. Thanks a lot, keep it up!
@randokaratajev2617 Жыл бұрын
What if I told you I'm really impressed with the other comments that don't mock other creators while praising this channel? I understand you wanted to praise this creator but you could have done it in a more civil way. How can one be that ignorant to rant others who are educating you for free? It's not like they have millions of viewers/subs. Most peak at 100k max and that's pretty much nothing compared to todays youtube standards.
@nyeponpon Жыл бұрын
@@randokaratajev2617 you have a fair point, I should've thought better before commenting this. I apologize.
@leondecastro18075 жыл бұрын
You know, I was having a bad day because I couldn't implement my camera properly until I saw this video. Good thing I subscribed to you back then, you are a god send sir GameMakerStation!
@edp56235 жыл бұрын
I've watched many videos on cameras for gms2, this one helped me the most.
@trex0n353 жыл бұрын
I just gotta say, I love that your out here making quality content. This is such an upgrade to the camera I had before, I can't thank you enough :))
@CoffeeAI2013 жыл бұрын
For anyone experiencing a jitter when the camera gets close to the target, replace “/“ with “div” when dividing by 2 This seems to be an issue with larger resolutions. I’ve noticed it in sprites with a lot of detail. Switching from “/“ to “div” cleans up the division and really smooths the camera out
@bradleypaquet72622 жыл бұрын
Thanks so much for this
@Vizeff5 күн бұрын
This did so much for my game! Thanks a lot!
@AngelloMaggio Жыл бұрын
Love how direct your videos are, thank you so much for the help
@kevgmei4 жыл бұрын
Thanks, dude! Quick and to the point. Definitely putting you in the credits of my game for helping me out.
@TheAngryLibrarian2 жыл бұрын
Thank you so much! This was the first tutorial I found that covered both following and zooming (and actually worked in my GM).
@bohdankulyk6672 Жыл бұрын
You are so kind to share this valuable information! Thank you very much!
@ARamirez1502 жыл бұрын
Finally, another GML tutorial creator who's really good at explaining things! (Shaun Spalding and Heartbeast being the other two)
@celesteorsa3918 Жыл бұрын
also FriendlyCosmonaut
@cjd03083 жыл бұрын
Thank you so much for this tutorial. It was so helpful that I just signed up for your course!
@TinyGamesLab5 жыл бұрын
Great content, as always! Keep it up Matharoo!
@GameMakerStation5 жыл бұрын
Thank you!
@likwid-official3 жыл бұрын
Thanks a ton for this tutorial! Very in-depth and helped me understand how all the of the code works!
@betatester034 жыл бұрын
Holy crap, man. This was a fantastic tutorial. I love your approach to presentation.
@GameMakerStation4 жыл бұрын
Thank you :)
@joezuru37533 ай бұрын
@@GameMakerStation is there a way to make the camera pan ahead rather than behind
@MacSacred4 жыл бұрын
Outstanding tutorial, thanks alot. I like the animations you did to frame the precise parts you're talking about, it allows the tutorial to be more dynamic and get straight to the point. It also helped structuring the code in my mind. I'm amazed at the quality of this video.
@wozatronics3 жыл бұрын
Greetings, thanks for the Tut, I'm only a lowly beginner at coding lol. But very easy to follow and re create. Thanks for your hard work. Its appreciated.
@nanashi37114 жыл бұрын
This is one of my favorite GameMaker tutorials! Great job! Note that zooming outside the size of the room will cause the camera to move in a way that the camera will cause the room to appear in the bottom right. One of the easiest ways to fix this is by commenting out the clamp functions and then the camera will center the room just fine.
@Fioravante_10 ай бұрын
THANK YOU MAN!
@vosovoso52202 жыл бұрын
this is such a good tutorial!
@hector_dgz945 жыл бұрын
your content is great, i wish you had more subs :D
@johnroberts80885 жыл бұрын
Great tutorial, any chance on making one where you drag/pan/zoom like you would on google maps? So not follow a player but smooth click/drag/pan with just the mouse?
@GameMakerStation5 жыл бұрын
You can modify this one to only pan and zoom, and not follow the player. Should work perfectly.
@johnroberts80885 жыл бұрын
@@GameMakerStation Great thanks!!!! Keep up the amazing work!
@johnroberts80885 жыл бұрын
@@GameMakerStation Sorry one last question, do you think it is possible to pan and add easing one you let go of the mouse? You know what I mean? So you drag and pan then on release it still moves a bit easing down to stop. Thanks!!!
@GameMakerStation5 жыл бұрын
@@johnroberts8088 Yeah, you can store the camera's raw coordinates in your own variables, then interpolate (using lerp) the actual camera coordinates to them.
@johnroberts80885 жыл бұрын
@@GameMakerStation Brilliant, thank you my friend, I will work on this. Congratulations on all your amazing content!
@wozatronics3 жыл бұрын
Fantastic Matharoo, well over my head, but awesome to use in my current project. Thanks for you time and effort in making these videos. Because of my lack of knowledge in using gamemaker, I cant get the camera to work across multiple rooms :-( Any help would be appreciated. I've attached a draw event to the camera, that draw a sprite for the background, it slowly rotates, it works on the great on the first room, but then it disappears on the 2nd room. Thanks. Paul.
@mrnobody7600 Жыл бұрын
How can I make it so the camera won't exceed the room's width and height? I don't want the players to see the black parts.
@oakbyte45803 жыл бұрын
Amazing work, thank you so much, helped me alot!
@Spoungebobsquarepan Жыл бұрын
Thanks a lot!!🙌
@Damian_Stefann5 жыл бұрын
I am not using gamemaker but these tutorials are perfect !!! i have some problems with differences but it´s perfect!
@GameMakerStation5 жыл бұрын
Great, what engine do you use?
@FoxyOfJungle4 жыл бұрын
Thank you so much! You helped me a lot! I spent all my day trying to do it but wasn't too good like this! I subscribed. :D
@RylanVG5 жыл бұрын
Good video. You are clear and concise.
@iMRDY993 жыл бұрын
Thank you so much for the tutorial..
@m77mdsd34 жыл бұрын
can you make a 2 players camera tutorial and when the 2 players are near to each other the camera will be 1 and if they arenot they will be 2 cameras one for first player and one to the second
@chutney883 жыл бұрын
Hi. Can this method of panning and zooming be combined with the 2.5d parallax camera? Thanks.
@lilbigman58804 жыл бұрын
Awesome tutorial!
@carlocgames26963 жыл бұрын
Simply the best!!!
@isaac72538 ай бұрын
Really great except that there's a weird little jitter when the player stops moving and the camera slows to a halt, tried using div instead of /, but that didn't fix my problem
@GuyHeroism4 жыл бұрын
so awesome man!
@thirdworldrider69919 ай бұрын
hi my friends, love the camera, adapted it to my space 2d game. I am wondering which value would I have to manipulate to get a smooth zoom with the mouse wheel instead of like a stepping or increment zoom. Like if I shove the mouse wheel forward, it'll keep zooming until it reached the desired value then stop. I tried making a zoom factor based on the mouse wheel, but cannot get it to go that way. I basically want to add a max zoom out level and a max zoom in level. I dont think it can be done with the current code how the mouse wheel is used to zoom. A max cameX/Y position changes based on where the player is, so setting a max for that wont work.
@BrendonReimer7 ай бұрын
Instead of using a mouse zoom, I made it so clicking shift and alt would alter the variables zoomTargetW and zoomTargetH then did this in the step if (camW < zoomTargetW) && (camH < zoomTargetH) { addW = (zoomTargetW - camW) * 0.2; addH = (zoomTargetH - camH) * 0.2; camW += addW; camH += addH; // Position camX -= addW / 2; camY -= addH / 2; } if (camW > zoomTargetW) && (camH > zoomTargetH) { addW = (camW - zoomTargetW) * 0.2; addH = (camH - zoomTargetH) * 0.2; camW -= addW; camH -= addH; // Position camX += addW / 2; camY += addH / 2; }
@Mackievellian2 ай бұрын
@@BrendonReimer You can further refine this too. Come hither for I have found the legend of this comment section. Thanks for sharing. :)
@AIO20115 жыл бұрын
The tutorial is very good and helpful, but, in no point of the tutorial you explained that the created camera has to be deleted, specially when dealing with room changes. This could lead to some serious memory leaks. So anyone watching this tutorial, beware with that ;P
@GameMakerStation5 жыл бұрын
Good point!
@Riversofash4 жыл бұрын
So do we just add instance_destroy(); after all the code in end step? I’m not sure I’m understanding
@AIO20114 жыл бұрын
@@Riversofash no, you could on the room change event add a camera destroy to avoid this memory leak
@KrepperestlerStudio2 жыл бұрын
5:13 I did the exactly same thing. But game is subtracting _movex and _movey variables from camx and camy for each step. So camera position reaches to -ten thousands in a second.
@joezuru37534 ай бұрын
what if I want the camera to pan slightly AHEAD of the player rather than behind?
@randokaratajev2617 Жыл бұрын
tried it. Works fine but I think you forgot one of the key features about zoom in games: They are limited. Your code lets you zoom out more than the room size itself. How would one limit this to room_width or height ?
@lebedzecom3 жыл бұрын
Круто! А будет ли это работать м Android games?
@nyeponpon3 жыл бұрын
Oh, also, I have a question: is it possible to make a "perimeter" where the cam can move? I don't wanna players to move the camera outside the room- it gets a ugly visual bug when it happens.
@GameMakerStation3 жыл бұрын
Use clamp() as it is shown in this video.
@davidprestenberg59762 жыл бұрын
how can I change what object the cameras following and keep the camera in the exact same position it was following the first object?
@davidprestenberg59762 жыл бұрын
ooo i figured it out just storing cameras x and y in the destroy event so the new one has a starting point
@aerobetamax60224 жыл бұрын
Genius!
@JustBrian. Жыл бұрын
how to add a limit to zoom?
@thirdworldrider69919 ай бұрын
need this!
@leniwolf2 жыл бұрын
not working for me, going insane. no idea what i'm doing wrong but when i import this code into my project, it's not working
@herom1234 жыл бұрын
Thankssss !!!!!!!
@powerpointdesigner73893 жыл бұрын
How to zoom in out using Pinch events for mobile platform
@MightyNO Жыл бұрын
6:56 For a second I thought my monitor was falling xDD
@pedroantonio7435 жыл бұрын
This tutorial is very useful, you could do a tutorial on how to do a screen shake efect?
@GameMakerStation5 жыл бұрын
Sure, I'll add that to my list. :)
@GameMakerStation5 жыл бұрын
Thanks for the suggestion. I've made a screenshake tutorial and uploaded it.
@pedroantonio7435 жыл бұрын
@@GameMakerStation thank you very much !!!!, you have helped me a lot.
@NoahNCopeland4 жыл бұрын
How would one tie this to a variable, like "Zoom," so that all you would have to do is increase or decrease Zoom and it will do the work...? In otherwise, how to divorce this from mousewheel
@NoahNCopeland4 жыл бұрын
Figured it out. It's quite simple. Posting for others: all you need is this in step: camera_set_view_size(camera,CamW*Zoom,CamH*Zoom) just make sure that CamW and CamH are set in the create event and never touched again.
@stegeflott4 жыл бұрын
How do I put a max zoom and a min zoom treshold??? in this code.....
@KowBasher4 жыл бұрын
I second the question - I've been messing around with clamping the addW and addH values, but no luck so far.
@GameMakerStation4 жыл бұрын
@@KowBasher Hi! You can apply clamping to the camW/camH after adding the addW/addH to them. Example: camW = clamp(camW + addW, minimumWidth, maximumWidth); However, this won't affect the "camX -= addW / 2" part, which means that the camera will still be offset. To fix that, you can simply wrap the camera offset part inside a conditional block, which would check if the camW/H have changed at all (which means that you have to store the original camW/H before changing them, in separate variables, and then do a != comparison for the offset block). Hope this helps!
@KowBasher4 жыл бұрын
@@GameMakerStation Thanks! I had it almost working but your code smoothed out the camera zoom when it hit the min/max height. (it would twitch) I found that by clamping the max value by room_width and height did the trick for my game as the map is a single grid. Thank you so much for the reply and help! Great videos and editing!
@gnarsloggethesloth30853 жыл бұрын
@@GameMakerStation I'm having a problem with twitching when the camera hits the min/max zoom? This comment thread seems to address this but I'm not sure if I'm doing it right, because with the info here it still twitches
@mrnobody7600 Жыл бұрын
@@KowBasher man can you share your code?
@ariessuggs38192 жыл бұрын
Anyone figure out how to restore original zoom level? is there a way to original level before changing it so I can make it go back? I is dum lol
@oldbomb3 жыл бұрын
Very nice tutorial as always, but I would like to add if you want to return to your starting resolution one time, it is better to use multiplying instead of adding for zooming, like this: //Zooming var factor = .1; var wheel = (1 +(factor *mouse_wheel_down()) ) /(1 +(factor *mouse_wheel_up()) ); if wheel != 1 and zoom *wheel > zoom_min and zoom *wheel < zoom_max{ zoom *= wheel; var corr_w = w *(1 -wheel) /2 var corr_h = h *(1 -wheel) /2 w = other.view_width /zoom; h = other.view_height /zoom; //correction position center x -= corr_w; y -= corr_h; }
@Boofener Жыл бұрын
where are you defining zoom? and view_width/view_height? im trying to add it to my dumb project but it just doesnt wanna work with what he has in the video
@robinrozo3 жыл бұрын
how i put limit to the zoom?
@GameMakerStation3 жыл бұрын
Use clamp()
@robinrozo3 жыл бұрын
@@GameMakerStation thank you
@rilysisumo94224 жыл бұрын
when i zoom in it stretches everything horizontally.
@GameMakerStation4 жыл бұрын
Hey, you can get help in our Discord server: discord.gg/TykHyqK
@arsray7285 Жыл бұрын
What accent is this?
@dr.gadget94743 жыл бұрын
👍👍👍👍👍👍👍👍
@mattp84554 жыл бұрын
Your avoid is super awkward! However, good job I learned a lot!!
@dr.gadget94743 жыл бұрын
СПАСИБО ЯНДЕКС ОЗВУЧКЕ ЧТО Я МОГУ СМОТРЕТЬ ЭТО НА РУССКОМ !!!!!
@officialshinky5 жыл бұрын
I liked the video, you put a lot of work in this i see! Don't let people hate on you because of your accent( just subscribe to pewdiepie and they'll love you )
@GameMakerStation5 жыл бұрын
Thanks! By now I'm used to people not liking my accent. I just try to do my best and to improve at the same time.
@joshc71545 жыл бұрын
@@GameMakerStation Your accent is great, and very rare. Like George Agdgdgwngo. Thanks for the tutorial!!