Game Development Community

Deleting script objects

by Vance Souders · in Torque Game Builder · 07/31/2006 (8:27 am) · 1 replies

What is the proper way to delete an object created with new in script? I've tried calling delete on sprites created with new, but they still appear on screen after the call. If I try to use safedelete, I get a console error saying the function cannot be found.

Also, am I correct in assuming that code like this will return a reference to the object:

%screen_point = new ScriptObject() { class="point2D"; };
%this_is_a_reference_to_a_point_2d = %screen_point;

//delete screen_point using the reference
%this_is_a_reference_to_a_point_2d.delete();

Thanks,
Vance

#1
07/31/2006 (4:02 pm)
That should work. Are you sure it's saying the function can't be found and not that the object can't be found?