• 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!

camera movement

  1. Y

    Question - Code Restrict camera movement

    Please give me insight how to achieve this: I have room with width 3000, but i want camera follow only to 2000 (the rest of room reserved for player 2, and separated by wall) I digging into camera manuals and testing different approaches whole day, still no success. <Image Link Removed - Malicious Domain Detected>/nDyj5F
  2. K

    GameMaker [Solved] Camera snapping to previous location when moving after moving it to other places

    Edit 1: Guess i just needed to post it here to change my perspective on the thing. Since i use x += floor((xTo-x)/5); y += floor((yTo-y)/5); i had to add x = viewposX; y = viewposY; in the initialization of the variables in my Global Right Down method. I have two objects which both have a...
  3. C

    GameMaker help with: Camera panning with mouse

    Hello! I am using the new camera system in GMS2 and i couldn't figure out how to pan the camera using the mouse. I want the same or similar panning to the GMS2 Workspace, where you hold down mb_middle and move the mouse to pan the view. My camera objects create event code: camera =...
  4. S

    Windows Odd Camera movement

    I am trying to program a top-down 2D game, where the camera is always facing the same way the player is (up). You move with W and S (increcing and decrecing velocity), and rotate with A and D, if I rotate while moving, my obj_player goes further away from the center and starts rotating around...
  5. H

    GameMaker Check if Camera is outside the room

    Hello, I use this code in the end-step event of my Hero object to move the camera on my top-down game: var targX = x-camera_get_view_width(view_camera[0])/2; var targY = y-camera_get_view_height(view_camera[0])/2; camera_set_view_pos(view_camera[0], lerp(camera_get_view_x(view_camera[0])...
  6. T

    Legacy GM Views and mouse detection...

    Hi, so in my game you control the player by moving the mouse. There are screen shakes, which I make by moving the view... This results in the player going crazy as the game starts detecting the mouse in different places. Is there a way to solve it? (BTW, in my game the views don't move for...
  7. G

    GML Camera Issues

    Hello there everybody. I am brand new to GameMaker and this is my first post. I am trying to code a particular 2D top-down camera that I can best relate to function with the Hotline Miami camera. However, there is a key difference that I am trying to implement but have been unsuccessful...
  8. B

    Camera problem in GM2

    Hey everyone, I recently upgraded to Game Maker Studio 2 and I noticed there is a new camera system. So I'm trying to revamp my old code so it uses cameras instead of the old views, but I ran into a problem. There is this weird shaking effect when the camera follows the player that doesn't...
  9. C

    Legacy GM [SOLVED] Fixing going diagonally faster in top-down game makes camera movement lag

    Hello. I'm making top-down game and when I "fix" speed when moving diagonally it makes camera lag if I move diagonally. I have obj_camera and I have set view to follow it in room settings. I have also tested without camera object but it doesn't help. Here is my code for player movement...
  10. D

    Camera movement.

    I posted about this before but does any one know why this may not work. I want it to move the camera to the next part like in Zelda. I Put this code in a Step function. This is my code. target_xview = (Player.x div 1000) * 1000; target_yview = (Player.y div 560) * 560; view_xview[0] =...
  11. D

    GameMaker Legend of Zelda like camera.

    Does any one know why this might not work? This is my code. target_xview = (Player.x div 1000) * 1000; target_yview = (Player.y div 560) * 560; view_xview[0] = target_xview; view_yview[0] = target_yview; I got this from a tutorial on youtube but edited it to fit my camera. People say it works...
  12. P

    GML Dynamic Camera code explanation

    I've been following Shaun Spalding's tutorials. One of his videos mentioned a code for something he called a dynamic camera. The code was following: var xTo, yTo; move_towards_point(mouse_x, mouse_y, 0); xTo = obj_player.x + lengthdir_x(min(256, distance_to_point(mouse_x, mouse_y))...
  13. S

    TDS Camera Motion Script

    Hi Guys, I've noticed how a lot of developers that create TDS games, lack smooth camera motion, and decided I would like to create a mini script that you could import into your game. Obviously this camera would have more applications than just your average TDS...
  14. E

    GML [SOLVED]Camera View/Follow player around (centered)

    How do I get the camera to follow around the player at its center, and for it to be a small area (zoomed in) so the player has to move and explore to see other areas of the map etc if you know what I mean?
  15. C

    View xview or yview problems (Solved)

    I've noticed that view_xview or view_yview is not on game maker 2 anymore, is there any alternative?
  16. D

    Room rotation

    instead of making my character follow the mouse in my new top down project, I decided I wanted the character to face to the top of the screen at all times, making the floor rotate once the player moves the mouse. it's by far not as easy as I thought since GameMaker doesn't seem to have a...
  17. A

    Questions about moving camera control object

    Hi guys. I'm fairly new to this, and I'm working on a 2D top-down maze/puzzle game, where the levels are dark. The player can only see a small area around them. I'm trying to include a camera control object, so that players will be nearer to the character, rather than see the entire level at the...
  18. V

    Legacy GM Camera stops following player

    As I was adding up more mechanics to my game I noticed that, for some reason, whenever my character is in his defense state script and moving, the camera stops in place, going back to following him when he stops moving or goes to another state. ///create camera...
  19. S

    Legacy GM [Question] How to: detect the end a "view sequence" | Change "view speed" on the fly?

    Hi Folks, I am pretty damn new to this GM stuff so please forgive me if I might ask something what is fairly easy or if a thread like this already exists... i probably didn't notice that. So I watched a few tutorials and tried to adapt it and use it with other things. Made my first useless...
  20. G

    Script Move Camera

    Hi, I'm new here in the forum and have a questions. I want make my camera move with the keyboard. But, i do no about script in game maker. if keyboard_check_pressed('vk_left') { view_xview[0] -= 10; } if keyboard_check_pressed('vk_right') { view_xview[0] += 10; } What is wrong?
Top