Hello. I am looking for a way of creating fake FPS hands, which are used in very popular FPS games. I tried multiple solutions that did not work, and now my last option is to ask here. Any comment is helpful, thank you.
You can load in some hands locally and have them positioned.
I tried this solution, but for some reason it does not look realistic at all (what I have created).
The easiest & fastest thing you can do is attaching some fake-arms model to the playerโs camera. There are some other things you can do that will take some extra time, like directly using the playerโs hands.
Could you show what you have made so you can be further helped.
Here is a code I used:
local runService = game:GetService("RunService");
local function get_Hands()
for _, v in ipairs(workspace:GetChildren()) do
if v:IsA("Model") and v.Name == "Hands" then
return v
end
end
end
local function render_Step()
local hands = get_Hands()
hands.PrimaryPart.CFrame = CFrame.new(workspace.CurrentCamera.CFrame, game.Players.LocalPlayer:GetMouse().Hit.p)
end
runService.RenderStepped:Connect(render_Step)
I tried this, but when I move the camera a bit too much up the hands are stuck on the entire camera.
Like 2 years ago I made a modified version of a nasty code thing that I found. The code used :Lerp to move the playerโs arms along with the camera. The code is messed up but maybe you can revamp it.
local player = game.Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
character = player.CharacterAdded:Wait()
end
local torso = character:WaitForChild("Torso")
local rightShoulder = torso:WaitForChild("Right Shoulder")
local leftShoulder = torso:WaitForChild("Left Shoulder")
local camera = game.Workspace.CurrentCamera
local UserInput = game:GetService("UserInputService")
local updateSpeed = .25
game:GetService("RunService").RenderStepped:Connect(function()
character["Right Arm"].LocalTransparencyModifier = character["Right Arm"].Transparency
character["Left Arm"].LocalTransparencyModifier = character["Left Arm"].Transparency
character["Right Leg"].LocalTransparencyModifier = character["Right Leg"].Transparency
character["Left Leg"].LocalTransparencyModifier = character["Left Leg"].Transparency
character.Torso.LocalTransparencyModifier = 0
local distance = (character.Head.Position - camera.CoordinateFrame.p).magnitude
if distance <= 1 then
character.Humanoid.CameraOffset = Vector3.new(0, 0, -.75)
rightShoulder.C0 = rightShoulder.C0:lerp((camera.CoordinateFrame * CFrame.new(1, -1.25, -.25)):toObjectSpace(torso.CFrame):inverse() * CFrame.Angles(0, math.pi/2, 0), updateSpeed)
leftShoulder.C0 = leftShoulder.C0:lerp((camera.CoordinateFrame * CFrame.new(-0.2, -1.5, -.6)):toObjectSpace(torso.CFrame):inverse() * CFrame.Angles(0, math.pi/.65, 0), updateSpeed)
else
rightShoulder.C0 = rightShoulder.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(0, math.pi/2, 0),updateSpeed)
leftShoulder.C0 = leftShoulder.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(0, -math.pi/2, 0),updateSpeed)
end
end)
Can I ask another question?
I didnโt succed making fake hands, but I made a first person visible character.
Now, it all looks fine when I look straight, but when I look up or down it looks weird.
Here are example screenshots (noting that I made your torso look at your mouseโs CFrame):
why not use the real hands and create ball joints. so the player can literally be holding the gun.
Hummm those images donโt give me so much understanding of what are you talking about. Maybe try removing that blurry effect and zooming out the camera so I can understand better whatโs happening
When I look up too much the character the hands are โcollidingโ with the camera. And when I look too much down it doesnโt look realistic at all, as the screenshots may tell.
Try playing a little bit with the values and the pi divisions. In the code I sent, the values are configured for suiting well with my old game-