Game Development Community

Changing the Class of a Copy

by Tom Lenz · in Torque Game Builder · 03/05/2008 (6:00 pm) · 1 replies

I am currently working on a game where I need to change the class of a clone that I have made. Currently I have tried using the following code:


%newTower = %this.clone();
%newTower.setPosition($WP);
%newTower.setClassName(tower);

Is this even close to being right?
Is it even possible to do?

#1
03/05/2008 (6:46 pm)
Tom,

Changing class is pretty easy. Like so:

%newTower.class = "tower";

There may be a function to do this, but I know that using the "class" field works.