hey, I was working on a gun system, And I was wondering how I would go about making a bullet drop. (Specifically has to work with the raycast) Here is a sample of the ray code:
Just use a projectile like how many other games do, Alot of people are coding their entire own systems but if you want to be optimized, use roblox’s built in system.
Use the actual bullet as the item then fire it with a linear velocity.
I don’t really know I am going to be honest but with my experience, Id say you apply linear velocity to the bullet the second it is spawned with the speed and direction you want, then make it a short burst so after that its moving purely from simulated momentum however it will fall from gravity.
You’d basically replace your raycast call with a call to Caster:Fire(…) and you’d make the Caster object by doing FastCast.new(). You can also add settings for the bullet drop.
There are probably lots of tutorials on it, and the docs should explain it.
If you are talking about hitboxes then you can go here
if you are talking about making your bullet being a projectile and having physics then learn about assembly linear velocity and the function BasePart:ApplyImpulse it applies a force to get a part from point a to point b.