• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Help needed with bone rotations

I've spent the past month working on getting a decent China Lake Grenade Launcher into KF, but I'm running into a problem where I'm getting different results between online and offline gameplay.

I was nearly ready to release the thing weeks ago, until I realized I could make its alternate fire raise and lower the leaf sight, and thus alter its shots' trajectories.

Offline, it works as intended, with aimed-while-the-sights-are-up shots going much farther whilst still aiming level with the ground. The problem is that during online gameplay, the projectile models don't spawn from the muzzle, and they ignore the player's pitch/yaw, only going in the same direction every time.

The code I believe responsible is within the gun's firing class, specifically its version of DoFireEffect, encased in the following spoiler. Any ideas for how to get it working online? Or should I just cut the project back and release it without the alt-fire and lobbing capability?

EDIT: My other thought for a solution was to get the bone's rotation and feed it into the SpawnProjectile function, replacing
p = Weapon.Spawn(GetDesiredProjectileClass(),,, Start, Dir);
with
p = Weapon.Spawn(GetDesiredProjectileClass(),,, Start, MRot);
however, it had the same end result: works in Solo, but not online.

EDIT2: Nevermind, I got some help from Zedek and it's working as intended both online and offline.
 
Last edited: