Game Development Community

Weapon offsets in 1st and 3rd person

by Andy Hawkins · in Torque Game Engine · 05/21/2006 (6:50 am) · 5 replies

I'm having trouble finding the right way to position the emitter point for gun fire when looking at the character in 3rd person.

Currently I'm using eyeOffset in 1st person in the weapon script so that the gun appears to be in the right place on screen. However when I switch to 3rd person the bullets are coming out of the character's head. I checked Beaver Patrol and it does the same thing.

Is there a way to have the bullets fire out the end of the gun in 3rd person while still being able to position the gun as I am in 1st person?

#1
05/21/2006 (7:15 am)
Projectiles are spawned from the player's eye vector, which is what causes them to appear to come from the player's head. It sucks, visually, but it's how things work. :/

Edited: At least on mine, correctMuzzleVector does nothing.
#2
05/21/2006 (9:56 am)
It depends if you're correcting the muzzle vector or not, and will affect whether the projectile spawns at the eyePoint or the muzzlePoint.
#3
05/21/2006 (10:25 am)
Yes I am correcting for the muzzle. But it's not spawning from the muzzle.

I'm using correctMuzzleVector = true; in the weapon script.

Is this right?
#4
05/21/2006 (12:29 pm)
The problem is it spawns from the where the eyeOffset is used to display the weapon in first person. The only way to get around this is to move the eyeOffset to something that looks close where the weapon is in third person, or just not use eyeOffset at all, in which case the weapon will show up where the player is actually holding it in both views.
#5
05/22/2006 (2:26 am)
@Paul - yep that idea works a treat thanks. I guess I'll just move the gun so the character holds it up a bit higher to his face.