Author Topic: Getting a weapon to swing in first person?  (Read 845 times)

Is this done model-wise or script wise because I have never been able to make this work.
I know that in gun-based scripts which play the animation shiftaway seem to work in first person but scripts using the sword's armattack do not.

Basically:
Code: [Select]
function weaponImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, armattack);
}

function weaponImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}
Does not work on custom weapons, while
Code: [Select]
function weaponImage::onFire(%this,%obj,%slot)
{
%obj.playThread(2, shiftAway);
}
does work on custom weapons.

Why is this?

[edit]
And yes I searched the forums already and couldn't find any clear answer.
« Last Edit: January 17, 2010, 10:28:56 PM by ladios »

Quote
~
Datablock ShapeBaseImageData(swordImage)
{
   // Basic Item properties
   shapeFile = "./sword.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";

   // When firing from a point offset from the eye, muzzle correction
   // will adjust the muzzle vector to point to the eye LOS point.
   // Since this weapon doesn't actually fire from the muzzle point,
   // we need to turn this off.  
   correctMuzzleVector = false;

   eyeOffset = "0.7 1.2 -0.25";
~
In your shape base image datablock.

Change that to 0

If you need the offset for some obscure reason, you're going to have to animate it your self.
« Last Edit: January 18, 2010, 03:42:45 AM by MtnDew »

Huh... that worked... Neat! :D

Yay thanks! I had this kind of problems in my addons too!