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

GML Smooth mouse-following cam & smooth player-following cam

V

Vakiuzo

Guest
(sorry weird english)
First time posting here, working on a classic top-down shooter with GMS2.
An invisible object "obj_smoothcamera" reads on a step event
Code:
if (instance_exists(obj_player)) {
    x += (obj_player.x - x) * 0.1
    y += (obj_player.y - y) * 0.1
}
So when obj_player moves, obj_smoothcamera follows the player, every frame a little bit slower.
but i'd also like the camera to follow mouse x & y so you can see better where you're shooting, and found Shaun Spalding video about this:

But it seems that "view_xview" got discontinued on GMS2. What should i do to keep my already smooth cam-follows-player thing and also the end result of Shaun Spalding video?
 
Top