Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Bullet casing flying out of the side of a gun?

Asked by
hudzell 238 Moderation Voter
9 years ago

By the title, I'm trying to make a bullet casing fly out of the gun's side, yet it only flies out in one direction, any help?

1 answer

Log in to vote
0
Answered by
RoboFrog 400 Moderation Voter
9 years ago

Well, for one, you could use a line like this to set its CFrame position and angle, and make an animation per bullet:

CFrame.new(x, y,  z) * CFrame.Angles(x,  y,  z)

Or, you could change Velocity and/or RotVelocity of the part being cloned as the casing (assuming you're cloning the casing in).

However, this method might not function correctly depending on how you're facing (the second might, the first probably won't default-ly). Therefore, you'll want to get the player's current CFrame stats and then modify the variable used accordingly.

You will want to check the CFrame of the torso (game.Players.LocalPlayer.Character.Torso )instead of an arm or something, since the torso will in most cases be facing the direction of the gun. Or, you could set a part where you want the casing to come from, and check its CFrame instead for a more sure measurement.

Good luck with making it!

Ad

Answer this question