[Resolved] Projectile Spawn Offset
by Steve Acaster · in Torque 3D Professional · 06/25/2009 (12:47 pm) · 4 replies
Custom weapons and projectiles.
Projectile spawns to the right of the muzzlepoint, can't see any reason for this in the scripts. Not an issue in Beta2. Built from a New Project.

EDIT
Resolved, as it never was a bug, just me using the wrong getclientobject() method.
Projectile spawns to the right of the muzzlepoint, can't see any reason for this in the scripts. Not an issue in Beta2. Built from a New Project.

EDIT
Resolved, as it never was a bug, just me using the wrong getclientobject() method.
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
#2
"correctMuzzleVector = true;"?
try it
I've seen no issues with this at all
06/29/2009 (12:05 pm)
you got"correctMuzzleVector = true;"?
try it
I've seen no issues with this at all
#3
After a bit more testing I think I might have worked out what happens.
I've an aim animation which moves the arms - and thus the weapon obviously.
But the projectile still fires from where the muzzlepoint was before the move, it's not updating the position of the weapon's bones/nodes, hence when aiming down the sight it still spawns the projectiles as though it was firing from the hip.
This wasn't an issue in previous betas.
So if you don't have an ADS animation to move the weapon, you wouldn't notice it.
06/29/2009 (1:23 pm)
@Deepscratch - Tried all combinations but it doesn't matter either way. After a bit more testing I think I might have worked out what happens.
I've an aim animation which moves the arms - and thus the weapon obviously.
But the projectile still fires from where the muzzlepoint was before the move, it's not updating the position of the weapon's bones/nodes, hence when aiming down the sight it still spawns the projectiles as though it was firing from the hip.
This wasn't an issue in previous betas.
So if you don't have an ADS animation to move the weapon, you wouldn't notice it.
#4
In my scripts I originally had been using the player's name which I had it set in the spawn script to "hero", so I don't forget what the name is when I call a .dump() or something.
So, hero.aim() worked fine.
Then I changed it to something a little better using getcontrolobject, and didn't notice the in-gmae problem for some time, and didn't think they were related. Until it just crossed my mind now. The things that pop into my head at 5.20am...
Embarrassingly moved to Resolved.
07/17/2009 (9:24 pm)
Disregard, I fubared.In my scripts I originally had been using the player's name which I had it set in the spawn script to "hero", so I don't forget what the name is when I call a .dump() or something.
So, hero.aim() worked fine.
Then I changed it to something a little better using getcontrolobject, and didn't notice the in-gmae problem for some time, and didn't think they were related. Until it just crossed my mind now. The things that pop into my head at 5.20am...
//causing the problem was
// %player = ServerConnection.getControlObject();
// and it should have been
%player = LocalClientConnection.getControlObject();
if (%player.getClassName() $= "Player")
{
%player.playthread("paim");
}Embarrassingly moved to Resolved.
Torque 3D Owner Kenneth Holst
Default Studio Name