Game Development Community

Creating Debris Error

by Azim Palmer · in Torque Game Engine · 07/10/2008 (10:10 am) · 0 replies

I'm trying to create some Debris to use as billboarded sprites, but the creation fails, any idea why??


datablock DebrisData( azDebris )
{

render2D = true;
texture = "~/data/skies/storm/blue_0006";
lifetime = 240;
lifetimeVariance = 0.0;
Category = "SpriteTest";
};

function DebrisData::create(%this, %obj)
{
echo("Create called");
echo(%this.texture);
}


// In a function

%myDebb = new debris() {
datablock = azDebris;
position = %obj.getposition();
};




The error I get is

scriptsAndAssets/server/scripts/weapons/SwarmGun.cs (442): Register object failed for object (null) of class Debris.


Please note that I know they can be automatically spawned at points, such as when something is destroyed, but I'd like to know how to spawn them at will.