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

How do I make my arms appear when going into first person?

Asked by 8 years ago

After browsing the internet, I have found some answers for first person arms and I have some premade scripts, the thing is, i don't know where to put the scripts. I want to make it so when you go in first person, you can still see your arms. Whenever i try this code, it doesn't work. I put it in the tool that i'm using, but nothing. Here is the code:

local arm = game.Workspace.Player["Right Arm"]:Clone()

local camera = game.Workspace.CurrentCamera
local model = Instance.new("Model", camera)
model.Name = "ViewModel" -- This was said to go in a local script, not sure where the local script's parent is though :/

arm.Parent = model

local weld = Instance.new("Weld", game.Workspace.Player["Right Arm"])
weld.Part0 = weld.Parent
weld.Part1 = arm

And if anyone knows how to hold a gun with both hands, aka making both hands go to the tool.handle.position, then i would love you forever, but that's just a bonus at the moment, not really working on the hands atm, but thanks if you do answer it :P.

2 answers

Log in to vote
0
Answered by
EgoMoose 802 Moderation Voter
8 years ago

I think this is a pretty common question for people who want to make FPS-esque weapons. A common response which I see was already posted is to weld fake arms onto the player. This would work, but if you ask me it's not the easiest way.

There's actually a property in parts that not everyone is familiar with because unfortunately you kinda either have to stumble upon it or already know about it. It's called LocalTransparencyModifier and it's what the game uses to make your character transparent when you zoom into first person. It turns out you can also use it to force it to do just the opposite. The only thing you have to be worried about is that you need to update it every frame because apparently Roblox really wants your character transparent when you're in first person.

local leftArm, rightArm; -- define these ahead of time
game:GetService("RunService").RenderStepped:connect(function()
    leftArm.LocalTransparencyModifier = 0;
    rightArm.LocalTransparencyModifier = 0;
end);
Ad
Log in to vote
0
Answered by 8 years ago

Weld the cloned arm to the players real arm rather than the other way around

Answer this question