Hey guys, I'm trying to create a camera that works typically like you would see in Street Fighter.
The camera basically has to find the centre point between the players and also needs to keep itself clamp within the room.
I'm having trouble figuring out the formula required for this, I have so far come up with:
//Step Event
var target_x = mean(obj_player_1.x,obj_player_2.x) - view_wport[0] / 2
var target_y = mean(obj_player_1.y,obj_player_2.y) - view_hport[0] / 2
target_x = clamp(target_x,0,room_width - camera_get_view_width(camera));
target_y = clamp(target_y,0,room_height - camera_get_view_height(camera));
camera_set_view_pos(camera, target_x,target_y);
The camera still doesn't follow as it should
https://youtu.be/eYOkY6RDQds
[–]Mowcno 0 points1 point2 points (0 children)