I would HIGHLY recommend, cannot emphasize enough, FastCast:
as @PysephDEV has already suggested. FastCast already has integrated piercing and allows for easy ricochet. If you are interested in making your own module, I would suggest looking at FastCast anyways as it uses a combination of raycasting as well.
Side note: If you do a single raycast for your fps framework, you will have no bullet arc or drop as it is a single, straight ray.
For further hit detection info, please see:
I have found it very useful when making my own FPS framework.
Bumping the post a bit here since I just got back to reading this
If you want a really simple solution without having to use some sort of external module like FastCast, you can just raycast between the bullet’s current position and it’s next position when you update the new position - I do this for my game’s spells, since I feel like using FastCast is an overengineered solution to something I don’t want to overcomplicate.
Isn’t that basically what fastcast does? just in multiple steps before each teleport?
FastCast’s api is a little strange. I was looking for something similar to FastCast for my own game, but I ended up just writing my own thing.
Yes and no. FastCast divides the whole trajectory / path the projectile should be going in and calculates the hitbox based off that, meaning you never input any object - this makes it annoying because it pretty much forces you to have bullets on client, causing a lot of other unecessary issues.
I’ve never used FastCast due to how overengineered it’s API is - it just seems like a niche developer tool for me.