Shell Ejecting For Guns

Hi I’ve been seeing all these guns that are amazing!
After they shot the SHELL flings out.
I was wondering how I could do this for my guns
Example
https://gyazo.com/208caa66844229e08be76273805f5e34

5 Likes

I am not the best scripter but I will say this anyways:
Maybe add a click detector that when you click it spawns in the shell. Then again when out of ammo it still happens. Im not sure. Like I said I am not the best scripter

Create the shell, position it where you want it, and add a bodyvelocity that gets cleaned up by debris shortly after.

2 Likes

This is what I do:

newShell.Velocity = (bolt.CFrame.rightVector) * 7.5 + Vector3.new(0,math.random(8, 23),math.random(-5,5))
newShell.RotVelocity = Vector3.new(0,math.random(50,300),0)

Basically what’s going on here is I clone the shell object, newShell, and position it a few studs to the right of the ejecting port (right relative to the port, not world). Then I apply a randomized amount of velocity and rotational velocity to it. Note that the velocity applied is applied relative to the rightVector of the ejecting port, so that the shell always comes out and away from the port in the correct direction.

7 Likes

Could you not just ask the person who did this directly or keep up with their threads? You don’t have to create a new thread for this unless you’re asking how to create a gun system in which you should probably first make an attempt and refer to our category guidelines for posting here.

cc @IiNaoriku