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.
Rockets go sideways when strafing
Rockets go sideways when strafing
Last edited by Swaffy on Thu Oct 27, 2011 9:36 pm, edited 1 time in total.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Rockets go sideways when strafing
I think this code line may be responsible. Set this to zero on the firearms object that fires your projectile:
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.
Code: Select all
ObjectTemplate.addRootSpeed 0
Setting it to zero will make it fire at the same velocity and angle no matter the speed of the host vehicle/soldier.




I have cameras in your head!
Re: Rockets go sideways when strafing
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!
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!
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Rockets go sideways when strafing
Sure no problem. Glad I could help. 




I have cameras in your head!