Delay when creating a TSStatic...
by University of Central FL (#0003) · in Torque Game Engine · 06/01/2006 (12:11 pm) · 1 replies
Hello,
I am programming a blob character who can shoot pieces of himself. I use the inventory/weapon system that is built in to torque since the blob can fire other objects as well and I thought this would work.
When he shoots a piece of himself, I create a TSStatic at the point that the fired projectile hits. To clarify, in the onCollision of the PieceOfBlobProjectile, I do the following:
That way it looks like the blob has fired a piece of himself, and the piece remains when it hits the ground.
Unfortunately there is a significant delay between the onCollision event and the creation of the TSStatic, at least a second. This is very jarring, and looks pretty bad.
Does anyone know why the delay is there, or a way I can get rid of it?
Thanks in advance.
I am programming a blob character who can shoot pieces of himself. I use the inventory/weapon system that is built in to torque since the blob can fire other objects as well and I thought this would work.
When he shoots a piece of himself, I create a TSStatic at the point that the fired projectile hits. To clarify, in the onCollision of the PieceOfBlobProjectile, I do the following:
function PieceOfBlobProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
// create a new torque logo ts static shape at the location of the collision
%splat = new TSStatic()
{
shapeName = "~/data/shapes/PieceOfBlob/splat.dts";
position = %pos;
};
// schedule the object to be deleted
schedule( 3000, 0, deleteSplat, %splat );
...
}That way it looks like the blob has fired a piece of himself, and the piece remains when it hits the ground.
Unfortunately there is a significant delay between the onCollision event and the creation of the TSStatic, at least a second. This is very jarring, and looks pretty bad.
Does anyone know why the delay is there, or a way I can get rid of it?
Thanks in advance.
Torque Owner University of Central FL (#0003)