I’ve seen many examples about shooting in unity using the physics approach and the transform too but something I was wondering is how to prevent bullets from changing speed while moving.
The Space Shooter Project by Unity guys is an example and you can download for free from the asset store. Here is the link in someone is interested:
As you can see in the example or in general, if you shoot without pressing any up/down key the bullets look with one speed but as soon as you press upwards while shooting the projectiles increse speed and vice versa while pressing backwars, I mean the bullets slow down until you get stuck at the bottom of the screen when the speed of the projectiles looks the same as you where not pressing any key while shooting.
A diagram would be:
Only Shooting : BULLET space space BULLET space space BULLET (Normal Speed)
Shooting + UP : BULLET space BULLET space BULLET (Fastest Speed)
Shooting + DOWN: BULLET space space space space BULLET space space space space BULLET (Slowest Speed)
Thanks in advance and sorry for my english I’m still learning ![]()
AnXgotta, first thanks for your answer. And let me tell you that I've been playing with the 'fire rate' changing it on the fly according to the up/down key pressed in an attemp to compesate the effect but it didn't work. Besides, the 'fire rate' in the script, this in particular and many others I've seen, doesn't change at all. It's always the same. I guess it has something to do with the player and bullet speeds. I've made some tests summing those speeds but didn't work either. Is it possible to solve the issue? Thanks again!
– odinpower22Just to clarify... you do mean that the player shoots bullets faster or slower when moving up and down? Not that the bullet projectiles move faster or slower after being fired, correct?
– AnXgottaExactly, when moving up/down the bullets seems to travel faster/slower respectively even though the fire rate won't change. For example, while pressing up and shooting the bullets look closer compared to when shooting only. Again, 'AnXgotta' thanks for your patience.-
– odinpower22Ok, I'll try to clarify: I won't talk about speed or fire rate only about what I'd like to see on screen and that is "I'd like to keep the distance beetween bullets constant independently of pressing up/down while shooting". And about loading the project right now there's no problem. I'll keep checking back until finding a solution. Thank you 'AnXgotta'.-
– odinpower22