Projectile always facing the same way
by Sam Redfern · in Torque Game Engine · 05/12/2006 (5:24 am) · 4 replies
I'm hoping someone will see what I'm doing wrong here.. no matter which direction my projectiles are moving in, they always face in the same direction.
This is a test function I'm using to fire the projectile:
And here's an example of a call using it:
fireMissile(1670, "382 397 55", "-1 0 0");
(1670 being a known object..)
thanks :)
This is a test function I'm using to fire the projectile:
function fireMissile(%sourceObj, %pos, %vec) {
%muzzleVelocity = VectorScale(%vec, MissileProjectile.muzzleVelocity);
%p = new Projectile() {
dataBlock = MissileProjectile;
initialVelocity = %muzzleVelocity;
initialPosition = %pos;
sourceObject = %sourceObj;
sourceSlot = 10;
//client = %obj.client;
};
MissionCleanup.add(%p);
return %p;
}And here's an example of a call using it:
fireMissile(1670, "382 397 55", "-1 0 0");
(1670 being a known object..)
thanks :)
About the author
#2
05/12/2006 (5:51 am)
Is your projectile model a billboard?
#3
In fact what happens is the model rapidly flickers between the correct facing and the wrong one, it's like the client thinks its facing one way and keeps getting overridden by the server, but then reverts back to the wrong way again...?
05/12/2006 (6:04 am)
No, its even behaving this way with the standard crossbow bolt.In fact what happens is the model rapidly flickers between the correct facing and the wrong one, it's like the client thinks its facing one way and keeps getting overridden by the server, but then reverts back to the wrong way again...?
#4
05/12/2006 (8:21 am)
OK, phew got it sorted. It was a side-effect of my mucking around with objects and whether they are interpolated and/or processTick'd depending on whether 'game time' is currently running (it's a stop-start turn based game, but even when gametime is stopped, things like cameras and the sky need to run as normal). The projectile class kept resetting the rotation to 0 0 0 1 in processTick, under the assumption that interpolateTick would fix it...
Torque Owner Sam Redfern