SMG grenade

  • Thread starter Thread starter Flakk
  • Start date Start date
F

Flakk

Guest
My question is simple. What function deals with the grenade's movement through the air? As you all know, the original grenade "spins" somewhat when it flies. I'm trying to stop that, making it always fly pointy-edge first.
thx :stare:

edit: I've managed to kill the spinning by editing this, in weapon_smg1.cpp: (default values are ( -400, 400 )

pGrenade->SetLocalAngularVelocity( RandomAngle( 0, 0 ) );
But something is still forcing the grenade to always spawn with it's point to a fixed position. So if I'm facing one way on the map, the grenade will spawn with it's point towards me, and if I turn like 90 degrees, the point will aim at the same spot as before.
Hope you're following me :X
 
Flakk said:
pGrenade->SetLocalAngularVelocity( RandomAngle( 0, 0 ) );
But something is still forcing the grenade to always spawn with it's point to a fixed position. So if I'm facing one way on the map, the grenade will spawn with it's point towards me, and if I turn like 90 degrees, the point will aim at the same spot as before.
Hope you're following me :X

You'll have to manually set it to the angle the player is facing. Maybe
pGrenade->SetAbsAngles(pPlayer->GetAbsAngles());

Not sure that will work, but something like that anyway.
 
haha, no way!! It WORKED : DD!
:thumbs:
I just inserted your piece of code, thinking "meh, maybe it works better than he thought", and it did, no errors or anything!
Thanks alot :D.
Shame I didn't figure it out on my own though :X.

I've somehow managed to kill the SMG bobbing though O.o... it's now static when one moves instead of swaying gently ... odd.
 
Back
Top