How would I go about making a bullet turn downwards to the ground?!
I find it a bit hard to do so because I cannot figure out the math to do so, could somebody please help me with this case?
How would I go about making a bullet turn downwards to the ground?!
I find it a bit hard to do so because I cannot figure out the math to do so, could somebody please help me with this case?
I used the following to model thrown projectiles and it works pretty well:
There are alternatives, such as FastCast which you should use if you don’t need to physically model the bullet, but just compute it’s trajectory.
Just to help you when you’re looking at this:
Projectiles don’t really “turn”. They just drop faster and faster over time.
If you were looking at a bullet from above, it would always look like it was travelling the same speed.
If you shot a bullet and dropped a bullet at the same time from the same height, they would hit the ground at the same time because the horizontal component is separated from the vertical component.
No like when bullets drop to the ground the do some sort of curve
I want to know how to do that
I’m very confused as to what you are asking here.
Bullets are usually so small and moving so fast that you can’t even see them so I’m not sure why you would need to model the curve of the bullet through the air like what is shown with the arrow in my resource linked above; therefore, I’m guessing what you mean by “turn downwards” is bullet drop. You are trying to make realistic bullet physics where the bullets have realistic bullet drop, correct?
If I’m right, then – as @BadDad2004 mentioned – you should try to learn how FastCast works, as it can handle all of your realistic bullet physics needs, along with hit detection and server-client networking.
Quick info on bullet/projectile physics:
In a world without air resistance, all projectiles (including bullets fired from guns, and arrows from bows) move in a parabolic arc. This is likely the “curve” that you’re referring to. Here’s a cool example from Wikipedia of a water fountain doing the same. I recommend reading that Wikipedia page and watching some Youtube videos about it if you want to learn more. Most schools teach this stuff in high school physics, so if you’re not there yet, it may be difficult to understand.
This parabolic curve also happens to be what my resource models, which you can see in the videos I posted. My resource is mostly made for slower moving projectiles like arrows or basketballs, but the basic projectile physics holds for bullets too. You could change up my example script to work for faster moving projectiles, but again, FastCast is probably better.
I was thinking like how big games paintball make their bullet curve dowards, thats what I mean.