1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

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

Discussion in 'Programming' started by ejoshuat, Jan 13, 2017.

  1. ejoshuat

    ejoshuat Guest

    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?
  2. jo-thijs

    jo-thijs Member

    Jun 20, 2016
    To "zoom in", you just decrease the view size.
    In the room editor, under the view tab, you set for "View in room" the values of W and H to something lower.

    To make the camera follow the player and keep the player centered, there are 2 main ways to go about it.
    1) Let GameMaker do it for you by going to the room editor under the view tab and select which object to follow.
    Then set Hbor to half the value of W for "View in room" and set Vbor to half the value of H for "View in room".

    2) Manually set view_xview and view_yview through code.
    mafon2 and Izumi like this.

Share This Page