Page 1 of 1

Rockets go sideways when strafing

Posted: Mon Oct 24, 2011 8:03 pm
by Swaffy
How can I make a rocket go perfectly straight when I fire it instead of it flying sideways from the direction I'm strafing?


For example, the Bazooka rocket will angle to the right when strafing to the right. Another is the Hydra [small] rocket on the Mi24D Hind in Desert Combat; the rockets will angle to the left when the helicopter is strafing to the left (it works for any direction the movement is going). I don't want my rocket to do this.

But when I fire the Hellfire rocket from the Mi24D Hind or the Katyusha rocket from a WWII vehicle (such as the Katyusha), the rocket flies perfectly straight, hitting the spot where the player was aiming at from the time the rocket was fired.

Re: Rockets go sideways when strafing

Posted: Thu Oct 27, 2011 10:48 am
by Apache Thunder
I think this code line may be responsible. Set this to zero on the firearms object that fires your projectile:

Code: Select all

ObjectTemplate.addRootSpeed 0
The command tells the game whether the direction or speed affects the projectile at launch. For example a grenade will go a bit faster when walking foward then when standing still.

Setting it to zero will make it fire at the same velocity and angle no matter the speed of the host vehicle/soldier. ;)

Re: Rockets go sideways when strafing

Posted: Thu Oct 27, 2011 9:36 pm
by Swaffy
It works, thank you. Now I just need to edit the projectile position.

My Mi24D's rocket kept blowing the helo up since the projectile was only going at the velocity speed instead of the velocity+vehicle speed.

This gives me a few ideas. Thank you again, AT!

Re: Rockets go sideways when strafing

Posted: Sun Oct 30, 2011 6:59 pm
by Apache Thunder
Sure no problem. Glad I could help. :D