Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | melka24 |
I would like the camera to follow the player only in the “up” direction.
Right now the camera is not a child of the player and I’m using a script to change the position of camera every frame:
func _process(delta):
player_pos = $Player.get_position()
if(float(camera_pos.y)>float(player_pos.y)):
camera_pos.y = player_pos.y
$camera.set_position(camera_pos)
Unfortunately, to me, it doesn’t seem so smooth (even with the smoothing option).
Is using a script really the best way to make the camera follow the player or is there a way how to have the camera as a child of the player?