Game Development Community

Emitter is slower then Projectile

by Zorro Davis · in Torque Game Engine · 03/20/2013 (2:25 pm) · 2 replies

I wanted to speed up the projectile's muzzle velocity (other then just raising the Muzzlevelocity) but the emitter wont follow the projectile at the same speed as the projectile. Any Help?

Here is what I used for the Muzzle Velocity increase:

function Projectile::onAdd(%obj,%a,%b)
{
if(%obj.dataBlock.getID() == Gunprojectile.getID())
{
%obj.initialvelocity=vectorscale(vectorNormalize(%obj.initialvelocity),800); //sets velocity to 800
}
Parent::onAdd(%obj,%a,%b);
}

#1
03/20/2013 (10:25 pm)
Eh, why don't you set the muzzlevelocity when you create the projectile?
(By that I mean setting it in the datablock instead)
#2
03/22/2013 (3:20 pm)
lol, can you give me a example, im kinda confused by what you mean