For those of you that are having script issues or other issues, and can't figure it out yourself or the video doesn't help (somehow), then you can use the model below. Don't just blindly copy and paste the viewmodel, try recreating the viewmodel yourself using the video or else you won't learn anything and won't be able to expand on the viewmodel. create.roblox.com/store/asset/16897515665/FPS-ViewModel-by-StuffyDev
I already knew how to create a ViewModel like this i just wanted you to explain the math behind the ViewModel instead of just saying "we are just gonna do a bunch of math"
OMG IT WORKED! i thought why does viewmodel doesn't apear? Its easy 1.Check if code is correct 2.Check if your viewmodel is named correctly and in code is a correct name of viewmodel like: in code is ViewModel but the model named Viewmodel
I'm having an issue I made a part thats suppost to remove the tool,But when it destroys the tool it leaves the viewmodel floating there and every time I try to destroy the viewmodel I get an error that its not a member of camera. would you happen to know how to fix it? Thanks in advanced😄
how do you make the gun be able to shoot? ive been trying to do this for a while but nothing works. Can you maybe explain this or make a video for it? Also, how do you make it where you can have multiple viewmodels? i tried to duplicate it with another weapon, but it doesn't work.
FOR ANYONE WHO WANTS THE FULL SCRIPT: local tool = script.Parent local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local Camera = workspace.CurrentCamera local RunService = game:GetService("RunService") local ViewModel local equipped = false tool.Equipped:Connect(function() equipped = true game.ReplicatedStorage.ViewModel:Clone().Parent = Camera end) tool.Unequipped:Connect(function() equipped = false ViewModel = Camera:FindFirstChild("ViewModel") if ViewModel then ViewModel:Destroy() end end) local swayCF = CFrame.new() RunService.RenderStepped:Connect(function() if player.Character.Humanoid.Health
you forgot to add this line under : local RunService = game:GetService("RunService") this goes under the line of code i have showed you: local uis = game:getservice("userInputservice")
im having this trouble where when i equip the tool the viewmodel along with the gun doesnt appear and when the tools equipped it would dissapear completely from the players backpack
@@UltraGamer5543-zc2gf I said the same thing, but scripts are useful whenever you want to switch their camera on command rather than whenever they join the game.
for some reason when I equip it the sway works but It moves me in the air and I can't move but I can still look around, I tried to fix it but nothings working do you know what the issue could be
i used this code for main menu button so now when i click start it does fps lock local player = game.Players.LocalPlayer local button = script.Parent local blur = game.Lighting.Blur button.Activated:Connect(function() blur.Enabled = false player.PlayerGui.ScreenGui.TextLabel.Visible = false player.PlayerGui.ScreenGui.TextButton.Visible = false player.PlayerScripts.FPS.Enabled = true end) (edit : forgot to say i renamed the Local Script FPS)
Thanks you for tutorial of roblox studio. You helped me with guns, cause it is a lot of broken or none working guns in toolbox. I'm creating a new game as same as RDR 2. I hope, I wiil be in Rock Star Games. RDR 3 is my dream. More likes for you.
@@niksiisieki im a new scripter and i just learned how to script/code in the last few months, and i made it so other people could see the gun i would probably share it to you all if it works in mobile (im still trying to make it work for mobile)
Try putting a localscript in startercharacterscripts and try this, --name Clothing "Shirt"-- workspace.Camera.ViewModel.Shirt.ShirtTemplate = game:GetService("Players").LocalPlayer.Character.Shirt.ShirtTemplate --or name of shirt-- for skin colour i don't know. This is all i could help with.
People out there, i recommend you to put a humanoid in the Viewmodel because it just makes you're arms smoother which makes you viewmodel look 10x better. No problem! Another solution, I had trouble with this one to but, if it does not appear but appears in the workspace then just get the model and get the position original and copy and paste from the m4a1 and paste onto you’re guns model and hands. Np! People.
I problem i have is that the viewmodel already shows up on screen without equipping the tool, I downloaded and used your model below and still have the same issue
if you used the model then its either you renamed something and then didn't update the scripts or you never ungrouped it from the folders, because I just tested the model and it works fine
@@StuffyDev Actually, I figured out the problem, I had a script from the last view mode; i had made with little experience and completely removed the old script and it works like a charm! Thank you
Please help me @StuffyDev when my tool is unequipped I still see the arms and the gun and I looked over my code and everything is right. If you need pictures please let me know and I can send them to you
Hey I just finished making this and I noticed something and I’m wondering if there’s any way to fix it at all even but it clips through walls. Idk if it’s possible to fix it without completely deleting it and just adding an overlay but I just wanted ask that
It clips through walls due to CanCollide being turned off. Unfortunately I don't know of a way to make it so it doesn't clip through walls without screwing up the whole model, as if you turn CanCollide on it will mess with player movement.
that means you screwed up with setting the viewmodels position to the camera, check what your view models name is along with the code underneath the runservice function
@@StuffyDev I also have the same problem but I literally used the Tool and StarterPlayerScripts in the model you provided. I made my own ViewModel by following the video
I believe that the problem is because of renaming the ViewModel itself and/or changing the ViewModel in game.ReplicatedStorage.ViewModel:Clone().Parent = Camera
If you are talking about aim down sights then you can just create a transparent part near the aim part of the gun and then just align the camera to the part position. If you are talking about weapon firing and reload animation you are gonna have to use something like blender or moon animator I hope this is the answer you were looking for 😭
hi I'm having issues on the view model every time I equip the weapon it spawns at the place I created instead of in front of me I tried using your model scripts below but nothing is working. pls respond
if you used the model then its either you renamed something and then didn't update the scripts or you never ungrouped it from the folders, because I just tested the model and it works fine
What I did, was that I made a gun model and then I welded the gun's parts to the tool's handle. It looks a little weird with the player holding it like a candle but I think it's better then nothing
@ryanphillips6335 i got 2 options for u , u can use fe gun kit wich has viewmodels and yt tutorials or u can use a script i made but then have to add animation scripts but its kinda easy
@ryanphillips6335 but i would recommend fe gun kit its very customize able and easy to use has cool gun features and everything u can animate everything just from a model script using integers , booleans and strings
@@DiellHoxhaj try using this model, move everything to the correct places as stated in the folder names (make sure to ungroup the folders once moved to the right places): create.roblox.com/store/asset/16897515665/FPS-ViewModel-by-StuffyDev
For those of you that are having script issues or other issues, and can't figure it out yourself or the video doesn't help (somehow), then you can use the model below. Don't just blindly copy and paste the viewmodel, try recreating the viewmodel yourself using the video or else you won't learn anything and won't be able to expand on the viewmodel.
create.roblox.com/store/asset/16897515665/FPS-ViewModel-by-StuffyDev
Thanks!
Where do i have to put the view model for it to work? Because when i spawn in it doesn't work.
also i can't find the gin kit anymore
i think ppl didnt weld the gun to the viewmodel
I already knew how to create a ViewModel like this i just wanted you to explain the math behind the ViewModel instead of just saying "we are just gonna do a bunch of math"
truly an underrated channel
bro when i saw you had a channel with programing tutorials i was not expecting to get lua flashbacks
HES MADE IT
OMG IT WORKED!
i thought why does viewmodel doesn't apear?
Its easy
1.Check if code is correct
2.Check if your viewmodel is named correctly and in code is a correct name of viewmodel like: in code is ViewModel but the model named Viewmodel
i just want to say thank you, ive tried so many other videos that dont work, and this one actually works, keep up the good work
ye but other players cant see the gun
@@niksiisieki u can probably look up another video for that problem
@@Viunly nah nvm i js used fe gun kit
I was trying to find gun models I could use and you saved me, thanks
I'm having an issue I made a part thats suppost to remove the tool,But when it destroys the tool it leaves the viewmodel floating there and every time I try to destroy the viewmodel I get an error that its not a member of camera. would you happen to know how to fix it? Thanks in advanced😄
how do you make the gun be able to shoot? ive been trying to do this for a while but nothing works. Can you maybe explain this or make a video for it? Also, how do you make it where you can have multiple viewmodels? i tried to duplicate it with another weapon, but it doesn't work.
i've been searching for this vid for so long
FOR ANYONE WHO WANTS THE FULL SCRIPT:
local tool = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local RunService = game:GetService("RunService")
local ViewModel
local equipped = false
tool.Equipped:Connect(function()
equipped = true
game.ReplicatedStorage.ViewModel:Clone().Parent = Camera
end)
tool.Unequipped:Connect(function()
equipped = false
ViewModel = Camera:FindFirstChild("ViewModel")
if ViewModel then
ViewModel:Destroy()
end
end)
local swayCF = CFrame.new()
RunService.RenderStepped:Connect(function()
if player.Character.Humanoid.Health
you forgot to add this line under :
local RunService = game:GetService("RunService")
this goes under the line of code i have showed you:
local uis = game:getservice("userInputservice")
@@maxfurbabuni capitals are important, its supposed to be, "GetService," and "UserInputService"
Thank my laziness couldn’t deal with this
@@gamingwithbros887 did it work for u?
for me no
@@idkwhattoputhere7826 same
hey man how do we add animations? I want to make a shooting animation but it won't work.
I did exactly what you did but ehen I equip the Tool the Gun and veiemodel doesnt show up
im having this trouble where when i equip the tool the viewmodel along with the gun doesnt appear and when the tools equipped it would dissapear completely from the players backpack
this video helped me to make my first view model!!
bull shit
My item is a camera, and i want that the cam, if we click (use it), it make a VHS effect, is it possible?
it worked! tysm
IT WORKS OMG THANK YOU SO MUCH
my character arm is showing. How to fix it?
Thanks for the turorial. You helped me a lot!
great tutorial and really good quality underated af
under rated dev fr, ur amazing dude
What if you’re making more than 1 gun?
Bro, u just got another subscriber, I have been looking for this
To simplify the FP (First Person) script you can say
"local player = game.Players.LocalPlayer
player.CameraMode = 1"
instead of that
imo its better to just change the properties in "StarterPlayer"
it just saves on a script
I don't even know why we needed a script for the FP go to starter player and change the camera mode
It is easier.
@@UltraGamer5543-zc2gf I said the same thing, but scripts are useful whenever you want to switch their camera on command rather than whenever they join the game.
for some reason when I equip it the sway works but It moves me in the air and I can't move but I can still look around, I tried to fix it but nothings working do you know what the issue could be
Dont work my left arm when I turn off collisions it makes the view model have no collisions
there isnt anything that can be done with the viewmodel clipping, its just how its gonna have to be.
@@StuffyDev alr got it
You should make a video on fist combat next 🙏
i need help the model dosent go yo my camera its just on the ground
did you anchor the camera?
@@i_am_SigmusYT what camera?
@@i_am_SigmusYT wait nvm i dont need help i fixed it already
The run service doesnt' work
i used this code for main menu button so now when i click start it does fps lock
local player = game.Players.LocalPlayer
local button = script.Parent
local blur = game.Lighting.Blur
button.Activated:Connect(function()
blur.Enabled = false
player.PlayerGui.ScreenGui.TextLabel.Visible = false
player.PlayerGui.ScreenGui.TextButton.Visible = false
player.PlayerScripts.FPS.Enabled = true
end)
(edit : forgot to say i renamed the Local Script FPS)
I can’t get the sway tho
do you know or have ideas how to make sway work on mobile
It should work on all devices? Did you test yourself
@@ObliviousNoob1 I tested myself. MouseDelta is really bad with touchscreen
Is there a way you could add an equip animation?
so if i make another gun i need to copy the script and viewmodel?
Thanks you for tutorial of roblox studio. You helped me with guns, cause it is a lot of broken or none working guns in toolbox. I'm creating a new game as same as RDR 2. I hope, I wiil be in Rock Star Games. RDR 3 is my dream. More likes for you.
you saved me omg thank you
underated dev
I did everything correctly and the first person code won’t work and the gun code won’t work either HELP
ik how to fix
It works TYSM
Will you do a part 2?
other ppl cant see the gun
@@niksiisieki im a new scripter and i just learned how to script/code in the last few months, and i made it so other people could see the gun i would probably share it to you all if it works in mobile (im still trying to make it work for mobile)
@Jails284 cuz its client sided lol, it was made in a local script
try doing a remote event or something like that to make this fire for the whole server not just the client, but i'm not sure if that will work
is there a way to make the ViewModel have the clothing and skin colour of the user?
Try putting a localscript in startercharacterscripts and try this,
--name Clothing "Shirt"--
workspace.Camera.ViewModel.Shirt.ShirtTemplate = game:GetService("Players").LocalPlayer.Character.Shirt.ShirtTemplate --or name of shirt--
for skin colour i don't know. This is all i could help with.
how to make multiple gun model work in the same inventory
Help me when I equip my gun and I'm starting fly
for some reason it always says "Equipped is not a valid member of backpack"
check the script and when you see the code "local item = script.parent" remove one parent in the code thats similer to the one i showed you
for the end of the script, i can't really see what it is saying. does it say "renderstopped".
Renderstepped. Renderstepped id something that fires before a frame starts.
What's on line 24
People out there, i recommend you to put a humanoid in the Viewmodel because it just makes you're arms smoother which makes you viewmodel look 10x better. No problem!
Another solution, I had trouble with this one to but, if it does not appear but appears in the workspace then just get the model and get the position original and copy and paste from the m4a1 and paste onto you’re guns model and hands. Np! People.
what?
i have this problem but i cant understand your comment
@@Jdh2k10 just put it in your model thats it lol
@@OSFlames man could you way it again? i have same problem but i cant undestand you too
I got a question my gun and viewmodel doesnt show or is still invisible whenever I equip the gun
did you add handle to your tool?
@@oliik_icy yes but it still doesnt work!
can you leave Link for The Script to copy
can we get one that's dependent on the playermodel
If you can script you can probably pull it off by copying the player's arms, resizing and rotating etc in the script
@@KaoPii-Dingus yeah i fucked around with the shoulder joints and got it working
Is it possible to animate the viewport when i press the left mouse button?
Hey there I have a question, does the view model appear on just the players screen or does it show the model to people as well?
its only on the players screen, as its attached to their local camera
@@StuffyDev oh okay, thanks for the tutorial though👍
@@StuffyDev How should you create visuals for the other players?
@@bananajesus667 in a server side script maybe,
It works thanks
hey, im having trobble with playing animations in the viewmodel, do you know how i could fix it?
I put the gun in starter pack, but when I equip it it shows up really far away and I can't use it. What did I do wrong?
Try Checking If Any part Is Anchored
How to animate the viewmodel?
My viewmodel is facing the wrong way, can someone help me figure out the solution
its not working can you make an video to fix the script
Is There Any Possible Way To Make It So That The Parts Are The Hands Of The Player?
i think its just place parts and name them left arm and right arm and position them
The viewmodel stayed at it's normal position, not at the camera, but i have wrote the script normally, what causes this?
Also, when i unequipped the gun stayed too.
Nevermind, i used R15
would you be able to animate this??
I problem i have is that the viewmodel already shows up on screen without equipping the tool, I downloaded and used your model below and still have the same issue
if you used the model then its either you renamed something and then didn't update the scripts or you never ungrouped it from the folders, because I just tested the model and it works fine
@@StuffyDev Actually, I figured out the problem, I had a script from the last view mode; i had made with little experience and completely removed the old script and it works like a charm! Thank you
what do i do if it shows up but its not connected to me?
can you write the code in the comments bc I messed it up
the viewmodel is invisible for somereason
Please help me @StuffyDev when my tool is unequipped I still see the arms and the gun and I looked over my code and everything is right. If you need pictures please let me know and I can send them to you
and other ppl cant see the gun
One little problem you need visuals for other players as the viewModel is only local sided and is not visible to other players.
what im saying do i put in normal script?
@@niksiisieki No - local scripts are the only ones able to access UserInputService. It'd error.
@@DivineFoxx nvm i used fe gun kit works so good
can you please put the tool local script in like a pastebin its really hard to copy down
use the model in the pinned comment
@@StuffyDev thats not the script dumdum
Can you make it third person compatible?
no thats why there is only arms
use your brain
@@superduperbob damn broskie don't have to be that rude💀
@@RawOpsis sorry im a christian now but i still agree😅
@@superduperbob 👍
can you do this but make the gun shot and do damage. If not, please make a tutorial for it. -Please and Thank you
already have a tutorial thats on my channel
@@StuffyDev Oh, sorry I am gonna watch that now.
@@StuffyDev And also there is a bug when you look down your player walks. Can you fix that?
Hey I just finished making this and I noticed something and I’m wondering if there’s any way to fix it at all even but it clips through walls. Idk if it’s possible to fix it without completely deleting it and just adding an overlay but I just wanted ask that
It clips through walls due to CanCollide being turned off. Unfortunately I don't know of a way to make it so it doesn't clip through walls without screwing up the whole model, as if you turn CanCollide on it will mess with player movement.
@@StuffyDev ok thanks for responding!
Hey. I coded my viewmodel and all. It didnt work, i then used your model and still didnt work. Do you know what went wrong on my code?
Did you typo the ViewModel name?
whenever i hold the tool nothing happens but the model just appears in its original spot and i dont get a viewmodel
that means you screwed up with setting the viewmodels position to the camera, check what your view models name is along with the code underneath the runservice function
@@StuffyDev I also have the same problem but I literally used the Tool and StarterPlayerScripts in the model you provided. I made my own ViewModel by following the video
The viewmodel provided works perfectly fine tho, not mine
I believe that the problem is because of renaming the ViewModel itself and/or changing the ViewModel in game.ReplicatedStorage.ViewModel:Clone().Parent = Camera
is there a way to animate this using CFrame positions?
If you are talking about aim down sights then you can just create a transparent part near the aim part of the gun and then just align the camera to the part position. If you are talking about weapon firing and reload animation you are gonna have to use something like blender or moon animator
I hope this is the answer you were looking for 😭
@@StuffyDev yes thanks!
I have followed this step by step three times, and i still can't see the view model or gun
did you add handle to your tool?
@@oliik_icy that might be it, thanks
It didn’t work I went back and checked everything and still did work the gun I used was a Glock from that gun pack
can someone copy paste the script if so?
how do i animate it like reloading and shooting
I don’t know why but my gun and viewmodel is invisible every time i equip my gun
try using the model in the pinned comment
@@StuffyDev still doesn't work
can you make a tutorial on how to make melee items?
hi I'm having issues on the view model every time I equip the weapon it spawns at the place I created instead of in front of me I tried using your model scripts below but nothing is working. pls respond
if you used the model then its either you renamed something and then didn't update the scripts or you never ungrouped it from the folders, because I just tested the model and it works fine
@@StuffyDev thanks for replying ill see what it is thank you
@@OMARTHEREF541 Did you figure it out?
@@PokerRat Sadly no maybe it might the gun cause i uses a diff one
@@OMARTHEREF541 ah shoot same.
How do I put aim mechanics in the gun?
Script them
add a transparent part where the aim part of the gun is and make the camera tween there I guess
how do i make the third person tool invisible but visible to others
what do you mean? like you want the wiew model to be visible to others too?
thank you very much bro
yoo does this work wit melees?
it works with anything that would be a tool in a players backpack
for me a random part just spawns when i use the gun and i cant walk cuz of the part
U did it wrong
make sure your handle isnt anchored
how to make it so when your third person, your gun viewmodel is disabled and when I go first person, the viewmodel is enabled?
if player.CameraMode = 1 then put everything in this if loop
@@DevKing_Phizo when I do that, the viewmodel doesn't appear when I go first person or third person.
@@GGEZLLL hmm try and improvise idk it should have worked is the player local player?
@@DevKing_Phizo Oh now it worked ty!!!!!!!!!
@@GGEZLLL np!
is it ok if i use only a mesh as the gun?
Yez
i owe you so much!
Pls, how to make it have recoil??
BRUH NOW ITS NOT WORKING BECAUSE IM SUCK AT SCRIPTS :(
can u link the whole script plz
2:32 (Just a reminder for me)
How do you create the server-side visuals to be seen by other players?
fr
What I did, was that I made a gun model and then I welded the gun's parts to the tool's handle. It looks a little weird with the player holding it like a candle but I think it's better then nothing
@ryanphillips6335 i got 2 options for u , u can use fe gun kit wich has viewmodels and yt tutorials or u can use a script i made but then have to add animation scripts but its kinda easy
@ryanphillips6335 but i would recommend fe gun kit its very customize able and easy to use has cool gun features and everything u can animate everything just from a model script using integers , booleans and strings
@@niksiisieki thats cool but I personally prefer to use a modified version of what StuffyDev has created
for me it creates on the beginning already an viewmodel
nevermind i had a another script for viewmodel
The model doesnt show up i take the tool but nothing
did you add handle to your tool?
didint really work for me, my gun just started to fly away XD
Can you put scrip in the comments it’s hard to read
when i equipped my gun it didnt show on the screen
did you add handle to your tool?
@@oliik_icy ye
could you write the script in the comments or the description by any chance?
go to the new pinned comment
put it in your game
change the viewmodel to anything you want
done
how can I fix the bug when the ViewModel stays in one place?
@@StuffyDev I did but now its invisible
@@DiellHoxhaj try using this model, move everything to the correct places as stated in the folder names (make sure to ungroup the folders once moved to the right places):
create.roblox.com/store/asset/16897515665/FPS-ViewModel-by-StuffyDev
@@StuffyDev it says i dont have perrmission
@@StuffyDev Im Sorry if im making you overwotk
@@DiellHoxhaj nah you good, idk why it doesn't give you permission to download it, lemme see how i can fix it