view_object

Object whose instance must remain visible in the view.

Syntax:

view_object[0...7]


Returns: Real


Description

With this variable you can get (or set) the object that has to be kept in the specified view (from 0 to 7) at all times. If there are multiple instances of this object, only one is followed (usually the first one created, but this is not guaranteed). You can also assign a single instance id to this variable, in which case that particular instance is followed. To prevent any view following, you can set this variable using the special keyword noone.



NOTE: You can set the distance that an instance or object can move before the view starts following using the view_hborder and view_vborder functions.


Example:

if instance_exists(obj_Player)
   {
   view_object[0] = obj_player;
   }

The above code checks to see if an instance of the object "obj_Player" exists and if it does, it sets view[0] to follow that instance.


Back: Views
Next: view_angle
© Copyright YoYo Games Ltd. 2015 All Rights Reserved