Skip to main content

The "vngen_instance_change" Function

Syntax#

vngen_instance_change(object, [perform]);
ArgumentTypeDescription
objectobjectThe object to create a new instance of
[perform]booleanOptional: Enables or disables performing Destroy and Create Events on replace

Description#

Safely clears the current VNgen object from memory while creating a new object in its place. While it is not required for the new object to contain VNgen script, it is required to run this script to change an object that does.

By default, this script will perform the Create and Destroy events of the new object. To disable this behavior, set the 'perform' argument to false.

To end a VNgen object without replacing it with a new one, see vngen_object_clear.

Example#

vngen_instance_change(obj_new);
vngen_instance_change(obj_new, false);