R
Ruzzle
Guest
I have a script that sets up the camera to an object:
This camera object (obj_camera) has a variable following, set's its x, y to that of the following object (following)
And the camera object has a variable for the previous followed object. (prev_follow)
Other objects can set the camera placement to another object with this script:
scr_camera_set(id,obj_camera);
This works fine for the camera to follow an object.
But now when i run the script again with argument0 as "obj_camera.previous_following" it won't follow the previous object.
Ideally I would be able to call this script (too) to 'reset' the following object to the previous object but with this script it doesn't seem to work.
If somebody could help me with setting the camera object back to the previous following object that would be great!
This camera object (obj_camera) has a variable following, set's its x, y to that of the following object (following)
And the camera object has a variable for the previous followed object. (prev_follow)
Other objects can set the camera placement to another object with this script:
scr_camera_set(id,obj_camera);
GML:
var moveto_obj = argument0
var object_cam = argument1;
if (object_cam.prev_follow != object_cam.following) {
object_cam.prev_follow=object_cam.following;
}
object_cam.following=moveto_obj;
But now when i run the script again with argument0 as "obj_camera.previous_following" it won't follow the previous object.
Ideally I would be able to call this script (too) to 'reset' the following object to the previous object but with this script it doesn't seem to work.
If somebody could help me with setting the camera object back to the previous following object that would be great!