Jump to content
Sign in to follow this  

Camera follow unit, but with only one coordinate

Recommended Posts


I know how to make a camera follow a unit, but what I really need is to make it follow a unit while updating only one coordinate of that unit. For ex, I want to follow a chopper that is moving accros the map, but I dont want the camera to change the altitude when the chopper does it. Im thinking this

_cam = "camera" camcreate [0,0,0];

_cam cameraeffect ["INTERNAL","BACK"];

_cam camsettarget heli;

_cam camsetrelpos [0,-15,0];

_cam camcommit 0;

_pos = getpos _cam;

_cam cameraeffect ["terminate", "back"];

camdestroy _cam;

_cam2 = "camera" camcreate [0,0,0];

_cam2 cameraeffect ["INTERNAL","BACK"];

_cam2 camsetpos _pos;

_cam2 camcommit 0;

while {alive player} do{

_cam2 camsetrelpos [(getpos this select 0),(getpos heli select 1), (getpos this select 2)];

_cam2 camcommit 0;


but loop doesnt work

Edited by BobbyBacala

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this