Gun System with Ricochet

Hey all, I just finished a neat gun system that has a lot of performance.
In this test, I’m using an M134 with an extreme fire rate. There is no reloading and the gun has infinite bullets. I have recoil disabled as this was really meant to be a performance test.
Please note I’m not a modeler and opted to use a ToolBox model which you can find here: gun model source

If you want to try it out for yourself feel free to look at it here: https://www.roblox.com/games/4830689165/GUN-Test

If you have any feedback please let me know!

3 Likes

That’s very cool! (pun intended)
If the bullets ricochet off the wall and hit an avatar do they deal damage? If not then it would be a nice feature to implement into your work :wink:

1 Like

Not currently as it proved to be very, very deadly. I could definitely make it so it deals far less.

1 Like

This is a really cool thing, I love it. Could you please tell me how you made it so server performant?

I would assume that this works by ray casting.

Ray cast for first time, check hit.
Create bullet and have clients interpolate it.
If it hits a valid surface, then it ray casts in the opposite direction, and then tells the clients to move the billet again.

Most likely there is an imposed limit (10 bounces e.g) and then it stops.