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

FPS Arms going crazy?

Asked by 10 years ago

I've been making guns for a while and as I have, I have found different ways to work with roblox physics and making FPS arms that are only visible by you. However, there are some strange problems with it. I have built the FPS arms into my guns, and the gun will remove them when you unequip the gun, but the problem is, sometimes, some of the guns will anchor you to position 0, 0, 0 and won't let you out until you unequip the gun. This happens 1 out of 2 times. So I need this fixed badly. I'm don't understand welds too much, but I know they keep parts inside each other. Here is the part of the gun script that inserts the FPS arms:

01--LOCALSCRIPT
02local Arms = {Player.Character["Left Arm"], Player.Character["Right Arm"]}
03local AM = Instance.new("Model", game.Workspace.CurrentCamera) --AM Stands for Arms Model
04AM.Name = Player.Name.."FakeArms"
05Arm1 = Instance.new("Part", AM)
06Arm1.Name = "Left Arm"
07Arm1.FormFactor = Enum.FormFactor.Symmetric
08Arm1.CanCollide = false
09Arm1.Size = Vector3.new(1, 2, 1)
10Arm1.Transparency = 0
11Arm1.BrickColor = BrickColor.new("Black")
12local Mesh1 = Instance.new("BlockMesh", Arm1)
13Mesh1.Scale = Vector3.new(0.9, 0.9, 0.9)
14Arm2 = Instance.new("Part", AM)
15Arm2.Name = "Right Arm"
View all 28 lines...

Any ideas as of why it does what it does?

1 answer

Log in to vote
0
Answered by 4 years ago

for FPS I prefer to use R6 real arms this is my local script:

01plr = game.Players.LocalPlayer;
02repeat wait() until plr.Character
03char = plr.Character
04m = plr:GetMouse()
05game["Run Service"].RenderStepped:connect(function()
06local c = game.Workspace.CurrentCamera
07 
08char.HumanoidRootPart["RootJoint"].C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y) + 1.55,3.15,0)
09 
10    char.Humanoid.CameraOffset = (char.HumanoidRootPart.CFrame+Vector3.new(0,0,0)):pointToObjectSpace(char.Head.CFrame.p + Vector3.new(0,-1.46,0))
11 
12end)
Ad

Answer this question