3 ways for the camera to follow the player | GMS2.3 Tutorial

preview_player
Показать описание
0:00 Intro
1:09 Option 1: Room Editor
4:26 Option 2: Code
10:39 Shorter Camera
13:32 Option 3: Smooth Camera
17:37 Outro

Links
Art Credit:

Playlist

Office Hours Submission Form ( for helping debug your projects on livestreams :) )

Tutorial Submission Form
Рекомендации по теме
Комментарии
Автор

FOR ANYONE HAVING ISSUES WITH SMOOTH CAMERA
use the camera code in a script, as seen in the video then copy and paste this code into your character. (if using dnd you can place an "execute code" block, put it in your steps, and paste it there.) you can change the .025 numbers to adjust how tightly the camera follows the player.


var target_x = x - cam_w()/2
var target_y = y - 150
var camX = lerp(cam_x(), target_x, .025)
var camY = lerp(cam_y(), target_y, .025)
camera_set_view_pos(
view_camera[0],
camX,
camY
)

Mr.Pineapple
Автор

Nice tutorial, thank you :)

After a few failed attempts to add the smooth camera effect though, I've just copied and pasted your ShorterCamera script and your "view follow player" code, its all works except that smooth camera isn't doing anything, there's absolutely no ease-in no matter what the settings are.
Is there something in the inspector settings in viewports and cameras or anywhere else that could be causing this?
Thanks

jimb
Автор

edit : nvm syntax error

the camera code isn't working : (
any idea why ?
6:44

metalicarus
Автор

Howcome you have code and i have buttons that i have to drag and i cant script -_-

helpingtutor
Автор

Can you make a smooth camera in drag and drop only?

Silentpartner