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);
}
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);
}
About the author
Torque Owner Lukas Joergensen
WinterLeaf Entertainment
(By that I mean setting it in the datablock instead)